I have been trying to use VB instead of C# to access methods in a .NET dll like in this blog:
Accessing .NET code from Xojo
I figured it out and I thought I would share.
Here is an example of VB class code for a class library that once added into a Xojo project using an Active X reference you CAN access the functions inside of the classes in Xojo.
[code]<ComClass(ReadAInput.ClassId, ReadAInput.InterfaceId, ReadAInput.EventsId)>
Public Class ReadAInput
Public Const ClassId As String = “7A15EB71-7F93-4495-BCA7-CD830D744818”
Public Const InterfaceId As String = “927154DF-9AD2-4352-8B1A-D4A21917F164”
Public Const EventsId As String = “5157FF1C-90E4-4DD8-9F1D-871E22386421”
Dim engunit As Single
Public Function GetInput() As String
engunit = 1
Return engunit
End Function
Public Sub New()
MyBase.New()
End Sub
End Class[/code]
More information is here:
VB COM Class MS Walkthrough
Don’t forget to “Register for Com interop” in the compile settings of your VB project!
@Paul Lefebvre
@Tim Hare
@Michel Bujardet