S
Simon K
LPTSTR szName ="";
sfn.lStructSize = sizeof(OPENFILENAME);
sfn.hwndOwner = hWnd;
sfn.lpstrFilter = NULL;
sfn.lpstrFilter = TEXT("Play List File(*.plc)\0*.plc\0\0");
sfn.lpstrCustomFilter = NULL;
sfn.nFilterIndex = 1;
sfn.lpstrFile = szName;
sfn.nMaxFile = MAX_PATH;
sfn.lpstrTitle = TEXT("Save Play list as...\0");
sfn.lpstrFileTitle = NULL;
sfn.lpstrDefExt = TEXT("*\0");
sfn.Flags = OFN_CREATEPROMPT | OFN_OVERWRITEPROMPT |
OFN_NOREADONLYRETURN;
if(bSetInitialDir == FALSE)
{
sfn.lpstrInitialDir = TEXT(".\0");
bSetInitialDir = TRUE;
}
else
sfn.lpstrInitialDir = NULL;
GetSaveFileName((LPOPENFILENAME)&sfn);
I'm trying to get a file name to SAVE something. I set the
OPENFILENAME structure as above and I call GetSaveFileName.
Well, the Save Dialog shows up and as I press the SAVE button on the
dialog, an access violation error occurs only to launch a disassembly
code.
I really don't get what I've done wrong with this.
sfn.lStructSize = sizeof(OPENFILENAME);
sfn.hwndOwner = hWnd;
sfn.lpstrFilter = NULL;
sfn.lpstrFilter = TEXT("Play List File(*.plc)\0*.plc\0\0");
sfn.lpstrCustomFilter = NULL;
sfn.nFilterIndex = 1;
sfn.lpstrFile = szName;
sfn.nMaxFile = MAX_PATH;
sfn.lpstrTitle = TEXT("Save Play list as...\0");
sfn.lpstrFileTitle = NULL;
sfn.lpstrDefExt = TEXT("*\0");
sfn.Flags = OFN_CREATEPROMPT | OFN_OVERWRITEPROMPT |
OFN_NOREADONLYRETURN;
if(bSetInitialDir == FALSE)
{
sfn.lpstrInitialDir = TEXT(".\0");
bSetInitialDir = TRUE;
}
else
sfn.lpstrInitialDir = NULL;
GetSaveFileName((LPOPENFILENAME)&sfn);
I'm trying to get a file name to SAVE something. I set the
OPENFILENAME structure as above and I call GetSaveFileName.
Well, the Save Dialog shows up and as I press the SAVE button on the
dialog, an access violation error occurs only to launch a disassembly
code.
I really don't get what I've done wrong with this.