VB.net and DLLs

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am using a component supplied by a company. This component is in fact a DLL.

According to their SDK (documentation only for C), I have to :

* Call load library
* Call getprocaddress
...

I wonder how I can tranlate these 2 calls using VB.net.

Can you advise me ?

Regards

F
 
Private Declare Ansi Function LoadLibrary Lib "kernel32" Alias
"LoadLibraryA" _
(ByVal lpLibFileName As String) As IntPtr

Private Declare Ansi Function GetProcAddress Lib "kernel32" (ByVal hModule
As IntPtr, _
ByVal lpProcName As String) As IntPtr

GetProcAddress *must* be declared as ANSI.

hope this helps...
Imran.
 
I wonder how I can tranlate these 2 calls using VB.net.

Can you advise me ?

Just write Declare statements for the functions in the DLL you want to
call. The runtime will call LoadLibrary and GetProcAddress for you.



Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top