• Advertisement

Archived

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

GetOpenFileName() in MFC???

This topic is 5670 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
Advertisement
try using CFileDialog.

CFileDialog fd(true);

fd.DoModal();

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

Share this post


Link to post
Share on other sites

  • Advertisement