DLL handle & DLL Function handle 
Author Message
 DLL handle & DLL Function handle

I need to get a handle to a dll, and then subsequently to a function in
the dll.
I'm using LoadLibrary to get the handle of the dll, but what about a
specific function?

-- JIM



Fri, 05 Jan 2001 03:00:00 GMT  
 DLL handle & DLL Function handle

Quote:

> I need to get a handle to a dll, and then subsequently to a function in
> the dll.
> I'm using LoadLibrary to get the handle of the dll, but what about a
> specific function?

> -- JIM

Jim,
Use GetProcAddress:

DECLARE:
Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long,
ByVal lpProcName As String) As Long

CODE:
DLLProcAddress = GetProcAddress(DLLModuleHandle, "DllFunction" +
Chr$(0))

Regards
Ian McLaren



Fri, 05 Jan 2001 03:00:00 GMT  
 DLL handle & DLL Function handle
Ian,
    Thanks for the reply.  -- JIM
Quote:


> > I need to get a handle to a dll, and then subsequently to a function in
> > the dll.
> > I'm using LoadLibrary to get the handle of the dll, but what about a
> > specific function?

> > -- JIM

> Jim,
> Use GetProcAddress:

> DECLARE:
> Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long,
> ByVal lpProcName As String) As Long

> CODE:
> DLLProcAddress = GetProcAddress(DLLModuleHandle, "DllFunction" +
> Chr$(0))

> Regards
> Ian McLaren



Sat, 06 Jan 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Calling DLL functions with type HANDLE

2. Passing a windows handle to a DLL-function

3. Help: DLL Function returns handle

4. Window handle in dll

5. Window handle in dll

6. Trying to pass a handle to DLL from VBA

7. How to pass a Form object/window handle to the DLL's constructer

8. ActiveX DLL Error Handling in VB 5

9. ActiveX DLL Error Handling in VB 5

10. Handling OCX/DLL files

11. PRIVATE DECLARE ... Handling returns (DLL)

12. Structured exception handling in C ActiveX dll??

 

 
Powered by phpBB® Forum Software