hi all
i need help:
i want to write dll using vb6. i dont know the rules to write dll.
can anyone help me write asimple dll.
anything. i just want to know how to start write dll in the vb6 and how to call that dll function
thanx
Printable View
hi all
i need help:
i want to write dll using vb6. i dont know the rules to write dll.
can anyone help me write asimple dll.
anything. i just want to know how to start write dll in the vb6 and how to call that dll function
thanx
1. Create new project
2. Go to File menu and select "Add Project"
3. From the dilaog select "ActiveX Dll"
4. In the main project go to Project > References and set references to Project2 (I kept project names as default so change Project2 to whatever name you might have)
5. Add the following code to your Class1 in the dll project
6. Add the following code to your Form1 code window in the main project:Code:Public Function CalcResult(a As Long, b As Long) As Long
CalcResult = a + b
End Function
7. Run main project and click on the button.Code:Private Sub Command1_Click()
Dim myDll As Project2.Class1
Set myDll = New Project2.Class1
MsgBox myDll.CalcResult(10, 20)
End Sub
That is a start.
Now, what do you want it to do?
RhinoBull as much as i understand you can write DLL's that when you put them in the COM+, some will work under Library in the COM+ and some under Server. why?what is the diffrence between the DLL's that installed under Library or under the Server
nice i creat that dll sample
and now i have "AplusB.dll".
how can i include this dll file to another vb6 project "standart windows form"
and how can i call it
thanx....
add a reference to the dll, in your std project, declare a variable and set the variable to the dll class
see item 6 in rhinobull post above
If may use activex dll in your project without referencing it - it's called "Late Binding":
Set myDll = CreateObject("MyDll.MyClass")
The only thing is dll must be registered so you'd have to distribute it with every project that needs it.