here is what I have to put into my code:
OPENFILENAME ofn; // common dialog box structure
char szFile[260]; // buffer for filename
HWND hwnd; // owner window
HANDLE hf; // file handle
// Initialize OPENFILENAME
ZeroMemory(&ofn, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hwnd;
ofn.lpstrFile = szFile;
ofn.nMaxFile = sizeof(szFile);
ofn.lpstrFilter = "All\0*.*\0Text\0*.TXT\0";
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
but I get 40 plus errors. I know that they MUST originate at the OPENFILENAME ofn; section. I included the proper header files, and still my definition of this structure isn''t working. What is my problem that it gives me dozens of "missing ;" syntax errors even though there is no obvious and stupid errors?
C:\Program Files\Microsoft Visual Studio\MyProjects\Map Editor\Editor.cpp(60) : error C2143: syntax error : missing '';'' before ''.''
C:\Program Files\Microsoft Visual Studio\MyProjects\Map Editor\Editor.cpp(60) : error C2501: ''ofn'' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio\MyProjects\Map Editor\Editor.cpp(60) : error C2371: ''ofn'' : redefinition; different basic types
C:\Program Files\Microsoft Visual Studio\MyProjects\Map Editor\Editor.cpp(45) : see declaration of ''ofn''
C:\Program Files\Microsoft Visual Studio\MyProjects\Map Editor\Editor.cpp(60) : error C2143: syntax error : missing '';'' before ''.''
C:\Program Files\Microsoft Visual Studio\MyProjects\Map Editor\Editor.cpp(61) : error C2143: syntax error : missing '';'' before ''.''
C:\Program Files\Microsoft Visual Studio\MyProjects\Map Editor\Editor.cpp(61) : error C2501: ''ofn'' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio\MyProjects\Map Editor\Editor.cpp(61) : error C2371: ''ofn'' : redefinition; different basic types
and so on and so on.....