Re: MFC extension dll initialization
On
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_MFCNOTES_TN033.asp
in section Initializing the DLL I read that I have to do. But there isn't
explanation if I have to do that when I use that dll from other dll and
concurrently from application.
If I do that then I'll create more then one instances of CDynLinkLibrary for
that dll. Is it correct?
On some computers it make a problem.
We have a lot installations where application run correctly, but we have
problematic installation, where program don't start.
We get a message
Runtime Error
R6031 - Attempt to initialize the CRT more then once.
I think that problem is in dll initialization.
Thanks
Palo
"Ajay Kalra" wrote:
You dont have to do any intialization unless you need to. AdvancedGUI.DLL
will load the dlls it depends upon when its loaded. You should setup your
dynlinklibrary in all dlls regardless of how they are loaded. I must be
missing something but why is this an issue? Is this causing any problem?
--
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com
"Palo Misik" <PaloMisik@discussions.microsoft.com> wrote in message
news:332A046F-2CEC-419F-B53E-BE8E1619CB59@microsoft.com...
I have MFC application, which uses several MFC extension dlls. For
simplicity
suppose their names are math.dll gdiext.dll and advancedGUI.dll.
All this dlls are used in application. (MFC in shared dll and dlls are
shared dll dynamically linked).
But between dlls are dependencies. advancedGUI.dll uses gdiext.dll and
math.dll,
Guiext.dll uses math.dll.
Do I have to initialize math.dll before first call from advancedGUI.dll is
done and Guiext.dll.
By initialization I mean this
extern "C" extern void WINAPI InitXxxDLL()
{
new CDynLinkLibrary(extensionDLL);
}
I have read this
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html
/_MFCNOTES_TN033.asp) before but I'm not still sure about dll
initialization.
Do I have to do an initialization within dll at all?
Thanks