I have written an MFC DLL (not an extension DLL) that uses the shared
DLL version of MFC 4.0 (under Visual C++ 4.0). This DLL is being
called from a non-MFC C program through an entry-point in the MFC DLL.
In this DLL I have a dialog that I want to display. Unfortunately the
call to DoModal fails. I have traced the failure to the call to
AfxFindResourceHandle() in DLGCORE.CPP at line 445. It seems that the
program has the correct resource ID, but can't seem to find the module
in which that resource is located. It runs through the linked list of
modules, including itself, but takes the default route and returns the
current module (the executable calling the DLL). Obviously the next
call to ::FindResource fails as the dialog resource is not in that
module.
Does anyone know what the problem is? I would appreciate any help with
this problem, as I am still relatively new to MFC (actually to Windows
programming as a whole).
Regards,
Cliff
--------------------------------------------------
Clifford Smith, Johannesburg South Africa
eMail: cli...@absa.co.za
csm...@global.co.za
WWW : http://www.global.co.za/~csmith/default.htm
--------------------------------------------------
You need to include the following code at the top of all your entry points
(your DLL's exported functions):
AFX_MANAGE_STATE(AfxGetStaticModuleState());
Later,
--
// Dean McCrory (dean...@msn.com)
BSTR bstrDisclaimer = ::SysAllocString(OLECHAR("I speak for myself, not
Microsoft"));
I have written an MFC DLL (not an extension DLL) that uses the shared
DLL version of MFC 4.0 (under Visual C++ 4.0). This DLL is being
called from a non-MFC C program through an entry-point in the MFC DLL.
In this DLL I have a dialog that I want to display. Unfortunately the
> cli...@absa.co.za (Clifford Smith) wrote in article
<31bbbac6....@hermes.is.co.za>...