-
Yeah...hum
Can somebody send me an example project of a dll because I want to know how to make my own dll's. I've never made a dll :( so please keep it easy. Or just give me the code for a dll that for example counts two integers up or something.
tanks for helping a poor beginner!
-
You know what Classmodules are? Have you made OCX's before? ACtiveX Dll's are almost the same as ActiveX OCX's except that you have Classes, not Controls in it.
-
OK,
Open VB, select ActiveX DLL.
In the code for Class1 enter the following code:
Public Function myfunction(txt)
MsgBox txt
End Function
Next go to File and select "Add Project"... select Standard Exe.
In Project Explorer, right click the Standard EXE project and choose "Set as Startup"
Add a button to the form. In the code for the button:
Private Sub Command1_Click()
txt = "Hello World"
Set s = CreateObject("Project1.Class1") 'create the COM object where Project1 is your ActiveX DLL and Class1 is your Class
s.myfunction txt 'call the myfunction method of the DLL
End Sub
This is a VERY simple example. Once the DLL is finished you would register is on your machine using: regsvr32.exe c:\full\path\to.dll
-
thanks
tanks for giving me my first lesson on how to make a dll!