CCustomFileDialog::CCustomFileDialog( ...):CFileDialog(true)
{
...
m_ofn.Flags |= (OFN_ENABLETEMPLATE);
m_ofn.lpTemplateName = MAKEINTRESOURCE (IDD_FILE_OPENSAVE); // IDD_FILE_OPENSAVE is custom file open save dialog
m_ofn.hInstance = AfxGetResourceHandle();
...
}
CCustomFileDialog *pDlg = NULL;
pDlg = new CFileDialogSC(...);
if (pDlg->DoModal()== IDOK)
{
...
}
char buffer[256];
sprintf(buffer, "DoModal Failled Error %d", CommDlgExtendedError());
MessageBox(NULL, buffer, "", MB_OK);
delete pDlg;
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
m_ofn.hInstance = AfxGetResourceHandle ();
GOOD:
m_ofn.hInstance = AfxFindResourceHandle(MAKE