关于使用getopenfilename多选多个文件是可以的。
以下是多选文件的代码
1 bool GetNeedOpenFilePath(vector<tstring>& vectFiles, HWND hwnd ) 2 { 3 OPENFILENAME ofn; 4 TCHAR szOpenFileNames[80*MAX_PATH] = {0}; 5 TCHAR szPath[MAX_PATH]; 6 TCHAR szFileName[80*MAX_PATH]; 7 8 int nLen = 0; 9 TCHAR* p = NULL; 10 ZeroMemory(&ofn, sizeof(ofn)); 11 12 ofn.lStructSize = sizeof(ofn); 13 ofn.hwndOwner = hwnd; 14 //ofn.hInstance = (HMODULE)GetCurrentProcess(); 15 ofn.lpstrFile = szOpenFileNames; 16 ofn.nMaxFile = sizeof(szOpenFileNames); 17 ofn.lpstrFile[0] = _T('