Sam
Fri Aug 01 23:27:15 CDT 2008
"Doug Harrison [MVP]" <dsh@mvps.org> wrote in message
news:5o42941hlp0sija7qa9h06g1cihlc3lblj@4ax.com...
> On Wed, 30 Jul 2008 19:29:49 -0500, BobF <nothanks@spamfree.world> wrote:
>
>>Igor Tandetnik wrote:
>>> Sam Hobbs <samuel@social.rr.com_change_social_to_socal> wrote:
>>>> Wrong. I avoid saying "wrong" but I don't know how to emphasize the
>>>> error here. What you are describing is implicit and explicit linking.
>>>> Implicit linking is where the linker uses a lib file and then during
>>>> execution the dll is located by Windows
>>>>
>>>> I am sorry for saying I don't understand what "statically
>>>> linked to a dll" means.
>>>
>>> The same thing as "implicit linking to a DLL", as you describe it. The
>>> two terms are often used interchangeably, probably because implicit
>>> linking involves a LIB file (an import library) and thus closely
>>> resembles traditional static linking in how the project is set up.
>>
>>I have *never* heard the phrase "implicit linking to a DLL" until this
>>thread.
>
> MSDN uses the term:
>
> Linking an Executable to a DLL
>
http://msdn.microsoft.com/en-us/library/9yd93633%28VS.80%29.aspx
> <q>
> Implicit linking is sometimes referred to as static load or load-time
> dynamic linking. Explicit linking is sometimes referred to as dynamic load
> or run-time dynamic linking.
>
> With implicit linking, the executable using the DLL links to an import
> library (.lib file) provided by the maker of the DLL. The operating system
> loads the DLL when the executable using it is loaded. The client
> executable
> calls the DLL's exported functions just as if the functions were contained
> within the executable.
>
> With explicit linking, the executable using the DLL must make function
> calls to explicitly load and unload the DLL and to access the DLL's
> exported functions. The client executable must call the exported functions
> through a function pointer.
> </q>
>
> --
> Doug Harrison
> Visual C++ MVP
Correct. Since most of what you say is a quote from the documentation I do
of course consider that to be correct.
There is just one more thing worth mentioning. Delay loading is somewhat a
combination of the two. Delay loading uses implicit linking except the DLL
is not loaded until an actual call to the DLL is made. If the DLL is never
called in a specific instance of execution, no error is issued. This is the
behavior that explicit linking is often used for; that is, to not fail if
the DLL is not present and is not needed. I recently researched wdmapi.dll.
It exists only in Vista. Windows applications use it but only if executing
in Vista; if the Windows version is XP, the application does not call
wdmapi.dll. If you use Depends to view the application using XP, Depends
will complain that wdmapi.dll does not exist but the application won't fail
for lack of wdmapi.dll.