Dialog doesn't show in explicitly loaded dll
Hi,
I have a control panel applet that shows a dialog by calling an exported function with a LoadLibrary and GetProcAddress. This "C" externed function resides in a dll that is dynamicaly linked to MFC. The control panel applet is a simple win32 dll.
As the documentation reads, I am calling "AFX_MANAGE_STATE(AfxGetStaticModuleState());" at the begining of the function.
The _DEBUG version works fine. The release does not.
In the release version, the dialog never show up. The return value from DoModal is IDABORT.
Any ideas?
TIA
Re: Dialog doesn't show in explicitly loaded dll
Hi, guy, showing Dialog(linked with a resource) in DLL is a little tricky.
you can change project-settings to achieve this. I developed a MFC DLL with a Dialog resource, and I created a CMyDialog (subclass of CDialog) with that resource. the DLL also export an "extern "C" function. In that function I create an instance CMyDialog dlg; and called dlg.domodal().
At first, it cannnot work, which I thought quite similar to your problem.
The solution is to change project-settings.
I make the DLL 'statically' linked to MFC, and all problems settled.
any questions email to [email protected]
development discussion are all welcomed.