Dialogs from a resource DLL don't work
Posted on 2004-08-05
I have an MFC application that displays a modal dialog. It works fine as long as the resources are in the application.
If I try to use the resource DLL, I call ::AfxSetResourceModule in the application's InitInstance method.
Strings and menus work fine - they are found from the resource DLL. However, dialogs don't appear. There's no assertion, no debug messages, etc.
I even tried the following (I've read it somewhere):
int CMyDialog::DoModal (void)
m_hInstSave = afxCurrentInstanceHandle;
afxCurrentInstanceHandle = ::AfxFindResourceHandle (MAKEINTRESOURCE (CMyDialog::IDD), RT_DIALOG);
return CDialog::DoModal ();
BOOL CMyDialog::OnInitDialog (void)
afxCurrentInstanceHandle = m_hInstSave;
if (!CDialog::OnInitDialog ())