Jump to content
  • Advertisement


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


GetOpenFileName() in MFC???

This topic is 5881 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

hi there I’m trying to create a ''open dialog box'' with GetOpenFileName() in an mfc model dialog. This is how I try to do it but it just does not want to work char fileName[256]; OPENFILENAME openParams; openParams.lStructSize = sizeof(OPENFILENAME); openParams.hwndOwner = m_hWnd; openParams.lpstrFilter = "Raw File (*.RAW)\0*.RAW\0\0"; openParams.lpstrCustomFilter = NULL; openParams.nFilterIndex = 1; openParams.lpstrFile = fileName; openParams.nMaxFile = 256; openParams.lpstrTitle = "Load RAW Image File...\0"; openParams.lpstrFileTitle = NULL; openParams.lpstrDefExt = "*\0"; openParams.lpstrInitialDir = NULL; openParams.Flags = OFN_FILEMUSTEXIST | OFN_READONLY | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY; if(GetOpenFileName(&openParams)) SetDlgItemText(IDC_FILENAME, fileName); Any ideas, or can any one help me with a better way to do this

Share this post

Link to post
Share on other sites
try using CFileDialog.

CFileDialog fd(true);


Its my duty, to please that booty ! - John Shaft

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!