-
October 17th, 2002, 08:32 AM
#1
Help me please : write MFC-DLL
- I built a MFC-DLL with VC++6.0
I add very simple function : Hello :
void Hello()
{
CFileDialog dlg(0);
dlg.Domodal();
}
and I export this function in .DEF file
- I use this DLL in VB6
An error occur :
...
File : afxwin1.inl
Line : 19
...
I look afxwin1.inl, line 19 :
Line 18 : _AFXWIN_INLINE HINSTANCE AFXAPI AfxGetInstanceHandle()
Line 19 : { ASSERT(afxCurrentInstanceHandle != NULL);
Line 20 : return afxCurrentInstanceHandle; }
Why that?
don't my dlg have Parent Handle?
What will i do to show that Dialog in VB?
(I must built MFC DLL, not use ATL)
Please show me
Thank !
Last edited by lad; October 17th, 2002 at 08:34 AM.
-
October 17th, 2002, 09:32 AM
#2
The problem is that program tries to find dialog template in
caller exe resource and not in dll resource. See details in MSDN
topic AFX_MANAGE_STATE.
-
October 18th, 2002, 06:28 PM
#3
But when I add this line into top of function :
AFX_MANAGE_STATE(AfxGetStaticModuleState());
Then Compiler error :
mfcs42d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in DLL_TESt2.obj
mfcs42d.lib(dllmodul.obj) : error LNK2005: __pRawDllMain already defined in DLL_TESt2.obj
I don't understand why
How can I do?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|