I'm doing a little game in DirectX, right now.
I've done a mapeditor for it, and now when I findly have got it working properly, I would like to have a open/save-dialogbox, so that you can be able to save different maps in an easy way.
And I found this code:
char szFileName[MAX_PATH] = "";
ofn.lStructSize = sizeof(ofn); // SEE NOTE BELOW
ofn.hwndOwner = hwnd;
ofn.lpstrFilter = "Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0";
ofn.lpstrFile = szFileName;
ofn.nMaxFile = MAX_PATH;
ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
ofn.lpstrDefExt = "txt";
// Do something usefull with the filename stored in szFileName
but I had some problem when I compiled it! It wouldn't recognice the OPENFILENAME class, does anyone know why?
Or do you know some other way to do this?
You probably have WIN32_LEAN_AND_MEAN defined...just #include <commdlg.h> directly.
Hm... I don't know if I did something wrong, but I still get the same error!
I suppose I have to do some reading here...
But thanks anyway, you're probably right, I've probably just made som other misstake!
Just a guess, but is comdlg32.lib linked in your project?
Post your compiler errors/warnings.