Message 1 of 8
Creating and using a DLL file using VB6

Not applicable
01-04-2002
07:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
As an experiment a I created a function in VB6
Public Function LaurieTest (sPar as String) as Boolean
Debug.Print "Hello World"
Debug.Print sPar
LaurieTest = True
End Function
I compiled this into a DLL file.
I then registered the DLL file with regsvr32 "LaurieTest.DLL" and was
rewarded with a message saying the file was successfully registered.
I then opened a VBA project in Land Desktop r2i, used Tools References to
attach the DLL to my project
and tried to run the following code
Sub Test (0
Dim bTmp as Boolean
bTmp = LaurieTest ("FOO WAS HERE")
End Sub
I was rewarded with a message that LaurieTest was an unknown function.
Interestingly, I typed it as laurietest and the system knew enough about it
to change the text to LaurieTest, but it would not recognise that I was
trying to add a parameter.
What have I missed in this process ?
--
Laurie Comerford
CADApps
www.cadapps.com.au
As an experiment a I created a function in VB6
Public Function LaurieTest (sPar as String) as Boolean
Debug.Print "Hello World"
Debug.Print sPar
LaurieTest = True
End Function
I compiled this into a DLL file.
I then registered the DLL file with regsvr32 "LaurieTest.DLL" and was
rewarded with a message saying the file was successfully registered.
I then opened a VBA project in Land Desktop r2i, used Tools References to
attach the DLL to my project
and tried to run the following code
Sub Test (0
Dim bTmp as Boolean
bTmp = LaurieTest ("FOO WAS HERE")
End Sub
I was rewarded with a message that LaurieTest was an unknown function.
Interestingly, I typed it as laurietest and the system knew enough about it
to change the text to LaurieTest, but it would not recognise that I was
trying to add a parameter.
What have I missed in this process ?
--
Laurie Comerford
CADApps
www.cadapps.com.au