Re: LoadLibrary question
"Tushar" <Tushar@discussions.microsoft.com> wrote in message
news:E201DAA9-7B82-46E1-80D6-50DDDDFB7F44@microsoft.com
Could anyone please let me know if it is possible to load a library
which has been built with a /MD compiler witch into an exe which has
been build with a /ML compiler switch using 'LoadLibrary'?
Yes.
I am sure that it can be done, but I want to know what will be the
implications of such a load? Would that be a good idea?
As long as DLL's exported interface is reasonably designed, there should
be no problems. Here "reasonably designed" means that the interface does
not require resources (e.g. memory) allocated in the DLL to be freed in
the hosting application, or vice versa.
Also, if at all I am to load a dll into an exe which has been
statically linked to C runtime libraries (using /ML option), should
the dll to be loaded be also statically linked to C runtime libraries
or it will be OK if the dll has been dyanamically linked with C
runtime libraries (using say /MD option)?
Again, if the "reasonableness" condition stated above holds, it does not
matter which flavor of the CRT the two modules link against. It's not
even required that the two be written in the same programming language.
After all, you can run multiple apllications written in all kinds of
languages, and they all successfully load kernel32.dll, user32.dll,
gdi32.dll and so on (DLLs provided by Windows OS).
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925