Original Post
Me and a friend are making a map editor and I wrote some code so that you can save maps but it doesnt work on his computer or my other friends computer. Neither of which have SP2. I tried it on my computer (Windows XP with SP2) and some school computers (Windows 98) and it works. Just in case this is important, I am using some win32 code to pop open the save and load dialog but the app is mostly SDL. Though I think it should work because SDL's windowing code is just a wrapper around Win32. Anyway, here is the source:
if((keys[SDLK_LCTRL]&&keys[SDLK_s])||(keys[SDLK_RCTRL]&&keys[SDLK_s]))
{
OPENFILENAME ofn;
char szFileName[MAX_PATHY];
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn); // SEE NOTE BELOW
ofn.lpstrFilter = "Wak Files (*.wak)\0*.wak\0All Files (*.*)\0*.*\0";
ofn.lpstrFile = szFileName;
ofn.nMaxFile = MAX_PATH;
ofn.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
ofn.lpstrDefExt = "wak";
if(GetOpenFileName(&ofn))
{
mappy.Save(szFileName);
}
}