what the use of loadlibrary API to load a dll ?
you declare an API, and it will auto load on runtime,
what do i need the loadlibrary ?
Printable View
what the use of loadlibrary API to load a dll ?
you declare an API, and it will auto load on runtime,
what do i need the loadlibrary ?
Normally, you don't need to use it. Possible reasons to use it, include....
1. You are going to call the function yourself using Assembly. Very useful if the API is created in a non-VB friendly format (i.e., _CDECL).
2. You want to test for a specific function within an API, you can load the DLL then call GetProcAddress to see if the function exists.
3. In some rare cases, you may want to use LoadLibrary to ensure the library is not released by VB before you want it released. By calling LoadLibrary, you create a reference to it and FreeLibrary releases that reference.
Thank you LaVolpe
I have another question related to that.
i understood that the declare statement, tells the linker to put
the dll and other information in the EXE File header,
and on runtime, Windows loader read that info, and load the dll for me.
if this is true, i didn't see a declaration for that
in C,
i asked in one forum, and they told me, that the linker link me to a Lib
that load the dll for me
so, there is no way to tell Windows loader to load dll, in C ?
or
there is no such thing, load a dll direct with help of Windows loader ?
(and in VB the declaration tells the linker to link me to a lib function that will load the dll for me)