Click to See Complete Forum and Search --> : GetProcAddress


Maghz
April 24th, 2001, 07:40 PM
Hi Everyone,

I'm having problems with getting the address of my only function in my DLL using GetProcAddress.
I have created a test DLL in VB 6.0 (Test.Dll). This DLL has one Multiuse Class. The class has only one public function "MyProc".
I use LoadLibrary to load the DLL, and use GetProcAddress to get the address for the function "MyProc". For some reasons, GetProcAddress passes ZERO for the address of "MyProc" function. Can anyone help please. Thanks.

Here is the code:
lHandle = LoadLibrary ("Test.Dll" & vbNullChar)
lProcAddress = GetProcAddress ( lHandle, "MyProc" & vbNullChar)

I get ZERO for lProcAddress!!!!

Clearcode
April 25th, 2001, 04:29 AM
It is my understanding that Visual Basic can only be used to create ActiveX dlls.
These DLLs do not have the #EXPORTS list for procedures so therefore GetProcAddress cannot deal with them.
There are 3rd party tools that are supposed to get around this, however.

-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com

Maghz
April 25th, 2001, 11:56 AM
Thanks very much for the info.