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:
On: http://winprog.org/tutorial/app_two.htmlCode:OPENFILENAME ofn; char szFileName[MAX_PATH] = ""; ZeroMemory(&ofn, sizeof(ofn)); 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"; if(GetOpenFileName(&ofn)) { // 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?
/Thanks FearOfTheDark