Try this very quick sample:
- open new project and select ActiveX Dll
- rename new dll project to Test
- rename class module to clsTest
- in the class module add the following function (you may modify it if you want)
VB Code:
Public Function AddValues(ByVal a As Double, ByVal b As Double) As Double
AddValues = a + b
End Function
- Now, go to File menu and add new standard exe project but do not close existing (project group will be created)
- go to project references and set references to Test (it will be about 4-5 item in the list)
- add command button to your form
- add the following code to your form
- set stamdard project to be startup (by right clicking on it and selecting appropriate option)
- run it and hit the button
VB Code:
Private Sub Command1_Click()
Dim cTest As Test.clsTest
Set cTest = New Test.clsTest
MsgBox cTest.AddValues(123, 123.765)
Set cTest = Nothing
End Sub