-
Hey,
I was wondering how I could export a set of routines into a .dll file...
I don't want to just add the functions to my template dir
And my .exe is growing in size, so I want to split the functions. And it'd be easier to debug... when I don't jump through all sorts of tested code!
Thanks
Thomas
-
To export them to a DLL, create a new ActiveX DLL and add the functions like you normally would to the module.
Code:
Public Sub Hello()
MsgBox ("Hello")
End Sub
Then make a new Project, add Refrence to your DLL and use the code below to use it.
Code:
Private Sub Command1_Click()
Dim myclass As Class1
Set myclass = New Class1
myclass.Hello
Set myclass = Nothing
End Sub
-
Ok, but...
Thanks, but isn't it possible to code a "decent" DLL ?
So I can Declare Function About lib "MyDLL" ?
Thomas
-
I have not tested it yet, but I believe you can do that. There is a lib file that is created when you make your DLL so use Project1 as your lib.
-
Megatron:
If you've added a reference then there is no reason to set your classes up... unless I missed part of your conversation and your doing something with a class elsewhere. Once you add the reference you can simply state:
Code:
Private Sub Command1_Click()
Hello
End Sub