-
How can I write a dll library ? I did this:
1. I have created a new project and choosen ActiveX DLL.
2. In Declaration section I wrote :
Public Sub Hello()
End Sub
3. Then I compiled this project.
4. Opend a new normal project, created a new module and wrote in it this:
Public Declare Sub Hello Lib "Project1.dll" ()
then in Sub Form_Load I wrote: Call Hello.
And I got this error : "Can't find dll entry in project1.dll".
What's wrong ?
-
You can't create Standard dlls in VB, you can only create ActiveX dlls.
the easiest way is to set the Instancing property of your Class Module File to 6 - Global multiuse, then compile it, when you want to use the functions in a different project hit references in the project menu and select the dll from there, you can then use the functions without declaring them.
The other way to use ActiveX dlls is to use them in an Object orientated way (which I highly recomend) check Here for some tutorials
-
If you want to create Standard DLL's, use Visual C++ instead.
-
There was a piece of software a while back which created real DLLs from VB code...can't remember what it is, though. I'll check.