Jump to content
  • Advertisement

Archived

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

Enselic

GetSaveFileName problem

This topic is 5661 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
It was the lack of ZeroMemory(&ofn, sizeof(OPENFILENAME)) who did it. It works when I zero the struct out.

Thanks for the reminder!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!