CodePudding user response:
Void CVC60Doc: : OnFileOpen ()
{
//TODO: Add your command handler code here
CFileDialog dlgFile (TRUE);
//if the use of new style!
OSVERSIONINFO VersionInformation;
GetVersionEx (& amp; VersionInformation);
If (VersionInformation dwMajorVersion & gt;
=5)DlgFile. M_ofn. LStructSize=88;//new=88
The else
DlgFile. M_ofn. LStructSize=76;//old=76
//
DlgFile. M_ofn. LpstrTitle="Open Bitmap File".
DlgFile. M_ofn. LpstrFile=m_fileName;
DlgFile. M_ofn. Flags |=OFN_EXPLORER;
DlgFile. M_ofn. HInstance=AfxGetInstanceHandle ();
DlgFile. M_ofn. LpstrFilter="24 bits Bitmap file (*. BMP) \ 0 *. BMP \ 0 any file (*. *) \ 0 *. * \ 0";
DlgFile. M_ofn. LpstrDefExt="BMP";
//show
If (IDOK==dlgFile. DoModal ())
{//update all views
SetTitle (m_fileName);
PRFileList - & gt; Add (m_fileName);
ShowLeftBmp ();
ShowMiddleBmp ();
ShowRightBmp ();
}
}
CodePudding user response:
Thank you, reply, OnFileOpen () of this function is to write your own, is not on the wizard to generate the code change, right?CodePudding user response:
Doc under the wizard class response: the commandID_FILE_OPEN