I'm a beginner! I try to use shared MFC libraries with an old dll, but when I compile it with VC6 I obtain the error "LNK2005: _DllMain@12 already defined". I found so many explanations, but only removing "_USRDLL" the issue disappear and the dll work. Now I'm a bit confused about the consequences of this action.
In addition, I read on MSDN that a USRDLL correspond to a regular DLL that statically links to MFC. So, when I create a new Win32 Dynamic-Link Library with VC6, why "_USRDLL" is already present if I choose in Project->Setting->Genaral "Use MFC in a shared dll" or "Not using MFC"? Sorry for my bad english and thank you for any help!
A regular DLL with the MFC never has a DllMain. This is covered by the CWinApp object.
Only Extension DLLs have a DllMAin. Read TN033. _USRDLL has to be defined in this case!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With