Re: MFC extension dll initialization

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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@xxxxxxxxx


"Palo Misik" <PaloMisik@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:332A046F-2CEC-419F-B53E-BE8E1619CB59@xxxxxxxxxxxxxxxx
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



.



Relevant Pages

  • Re: Share .cpp and .h along projects
    ... You may not care about memory/disk/download time/execution time savings, ... As for DLLs having "nothing to offer", ... libraries. ... Initialization of function static variables is well-defined. ...
    (microsoft.public.vc.language)
  • Re: error R6031
    ... /clr compiler switch is not used in app neither in dlls. ... When MFC app is exited there appears error message: ...
    (microsoft.public.vc.mfc)
  • Re: 2+2=4, but only once !?
    ... Richard Maine wrote: ... the initialization on first call only makes sense. ... However, if you make the mistake of thinking of DLLs as being a separate entity that functions like a program, then you might indeed be surprised to find that variables are only initialized on first call and subsequently retain their last assigned value. ... This is, obviously, a big potential issue with porting code designed to run as a standalone program into a callable DLL function. ...
    (comp.lang.fortran)
  • Re: mutual dependent DLLs and global variables
    ... DLLs should not be mutually dependent like this. ... topological sort of their dependency DAG. ... order of their initialization. ... >I'd say the best solution is to break the dependency. ...
    (microsoft.public.vc.mfc)
  • Re: MFC extension dll initialization
    ... in section Initializing the DLL I read that I have to do. ... I think that problem is in dll initialization. ... shared dll dynamically linked). ... extern "C" extern void WINAPI InitXxxDLL() ...
    (microsoft.public.vc.mfc)