利用VS的向導創建一個單檔案應用程式框架后,點擊檔案-》打開時會彈出:打開檔案對話框。如何對這個對話框操作呢?需要獲得它的指標吧?如何獲得?
uj5u.com熱心網友回復:
void CVC60Doc::OnFileOpen()
{
// TODO: Add your command handler code here
CFileDialog dlgFile(TRUE);
//if use new style!
OSVERSIONINFO VersionInformation;
GetVersionEx(&VersionInformation);
if(VersionInformation.dwMajorVersion >= 5)
dlgFile.m_ofn.lStructSize=88;// new =88
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\0Any file(*.*)\0*.*\0";
dlgFile.m_ofn.lpstrDefExt = "bmp";
// show
if(IDOK==dlgFile.DoModal())
{// update all views
SetTitle(m_fileName);
pRFileList->Add(m_fileName);
ShowLeftBmp();
ShowMiddleBmp();
ShowRightBmp();
}
}
uj5u.com熱心網友回復:
謝謝,回復。OnFileOpen()這個函式完全是自己撰寫的,不是在wizard生成代碼上修改的,對嗎?uj5u.com熱心網友回復:
向導下 doc 類 回應 : commandID_FILE_OPEN
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/149830.html
標籤:基礎類
上一篇:有關行人檢測代碼的運行問題
