I'm trying to create a .dll in VB Express with multiple functions and subs.
For the .dll program, I create a class module with:
Public Class Class1
Public Function ReturnOne(ByRef MyVar As Integer) As Integer
MyVar = 1
End Function
Public Sub ReturnString(ByRef MyVar As String)
MyVar = "ABCDEF"
End Sub
End Class
For the caller, I create a form with buttons:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyVar1 As Integer
ReturnOne(MyVar1)
TextBox1.Text = MyVar1.ToString
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim MyVar2 As String = "ABCD"
ReturnString(MyVar2)
TextBox1.Text = MyVar2
End Sub
End Class
Along with the form, I have a module with:
Module Module1
Public Declare Function ReturnOne Lib "C:\...\Test_DLL.dll" (ByRef MyVar1 As Integer) As Integer
Public Declare Sub ReturnString Lib "C:\...\Test_DLL.dll" (ByRef MyVar2 As String)
End Module
Upon execution, it tells me that it cannot find the entry point in the .dll. What am I missing?
TIA
John
For the .dll program, I create a class module with:
Public Class Class1
Public Function ReturnOne(ByRef MyVar As Integer) As Integer
MyVar = 1
End Function
Public Sub ReturnString(ByRef MyVar As String)
MyVar = "ABCDEF"
End Sub
End Class
For the caller, I create a form with buttons:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyVar1 As Integer
ReturnOne(MyVar1)
TextBox1.Text = MyVar1.ToString
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim MyVar2 As String = "ABCD"
ReturnString(MyVar2)
TextBox1.Text = MyVar2
End Sub
End Class
Along with the form, I have a module with:
Module Module1
Public Declare Function ReturnOne Lib "C:\...\Test_DLL.dll" (ByRef MyVar1 As Integer) As Integer
Public Declare Sub ReturnString Lib "C:\...\Test_DLL.dll" (ByRef MyVar2 As String)
End Module
Upon execution, it tells me that it cannot find the entry point in the .dll. What am I missing?
TIA
John