|
-
Feb 7th, 2010, 10:15 PM
#1
Thread Starter
Hyperactive Member
need an explanation about loadlibrary
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 ?
-
Feb 8th, 2010, 08:39 AM
#2
Re: need an explanation about 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.
-
Feb 9th, 2010, 06:17 PM
#3
Thread Starter
Hyperactive Member
Re: need an explanation about loadlibrary
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)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|