Hi, please can someone help me with the following.
I have a ComClass (so I can use it in Access) that has one public function. I would like to use this function for a button on a windows form in the same VB.Net project without using inherits and without instantiating it. Heres the code for the Com Class
----------------------------------------------------------------------
<ComClass(Scottie.ClassId, Scottie.InterfaceId, Scottie.EventsId)> _
Public Class Scottie
Public Function Bark(ByVal BarkType As String) As String
End Function
End Class
-----------------------------------------------------------------------
Heres how I want the code to look for the button on the form
----------------------------------------------------------------------
Public ClassForm1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Class
----------------------------------------------------------------------
At the moment it says Bark (in Form1) is not declared which is correct. I could make the function in ComClass a Public Shared Function and then use Imports Scottie for it to work, but then it won't work in Access because Access doesn't understand what Shared is.
Does anyone know of a way around this please?
Thanks
Stuart
I have a ComClass (so I can use it in Access) that has one public function. I would like to use this function for a button on a windows form in the same VB.Net project without using inherits and without instantiating it. Heres the code for the Com Class
----------------------------------------------------------------------
<ComClass(Scottie.ClassId, Scottie.InterfaceId, Scottie.EventsId)> _
Public Class Scottie
Public Function Bark(ByVal BarkType As String) As String
MsgBox(BarkType)
End Class
-----------------------------------------------------------------------
Heres how I want the code to look for the button on the form
----------------------------------------------------------------------
Public ClassForm1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Bark("Woof")
End Sub
End Class
----------------------------------------------------------------------
At the moment it says Bark (in Form1) is not declared which is correct. I could make the function in ComClass a Public Shared Function and then use Imports Scottie for it to work, but then it won't work in Access because Access doesn't understand what Shared is.
Does anyone know of a way around this please?
Thanks
Stuart