Archived

This topic is now archived and is closed to further replies.

Enselic

GetSaveFileName problem

Recommended Posts

When I debug and check the value in temp , it equals zero which means no error. But I don''t see a savefiledialog anywhere! Anyone know whats wrong?:
  
	OPENFILENAME ofn;

	ofn.lStructSize = sizeof( OPENFILENAME );//OPENFILENAME_SIZE_VERSION_400;

	ofn.hwndOwner = g_hWnd;
	ofn.Flags = OFN_OVERWRITEPROMPT;
	ofn.lpstrDefExt = "txt";

	GetSaveFileName( &ofn );
	DWORD temp = GetLastError();
  

Share this post


Link to post
Share on other sites
I tried your code out in a framework of mine and it does call the save dialog box. Make sure you are calling the function at some point and that your g_hWnd is properly initialized. Also it is a good idea to "ZeroMemory(&ofn, sizeof(OPENFILENAME));" after declaring your ofn variable, just to be safe.

Share this post


Link to post
Share on other sites