Win32 实现 MFC CFileDialog 对话框

时间:2014-07-07 08:31:40   收藏:0   阅读:327

void CWriteWnd::OpenFileDialog()
{
    OPENFILENAME ofn;      
    TCHAR szFile[MAX_PATH] = _T("");

    ZeroMemory(&ofn, sizeof(ofn));  
    ofn.lStructSize = sizeof(ofn);
    ofn.hwndOwner   = *this;
    ofn.lpstrFile   = szFile;   
    ofn.nMaxFile    = sizeof(szFile);  
    ofn.lpstrFilter = NULL;
    ofn.nFilterIndex    = 1;  
    ofn.lpstrFileTitle  = NULL;  
    ofn.nMaxFileTitle   = 0;  
    ofn.lpstrInitialDir = NULL;  
    ofn.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;

    GetOpenFileName(&ofn);

    /*if (GetOpenFileName(&ofn))  
    {
        std::vector<wstring> vctString(1, szFile);//保存添加文件的路径

    }*/
}

Win32 实现 MFC CFileDialog 对话框,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!