It says it’s possible, but after I build the dll it’s not in the Active X references anywhere. I am currently using VS 2010 express to build the dll but the blog says that should be ok. What am I doing wrong?
You cannot use .NET objects directly in Xojo. There was a Xojo blog in the past year that outlined how to wrap a .NET dll for use with Xojo, and I believe @Michel Bujardet has had success doing so. Search through the official Xojo blog and Michel’s posts.
Do I need to save or copy the dll to a specific place? Things are named a little differently in 2010 than 2012 but I tried to follow the blog and replicate it exactly. I am using Visual Basic 2010 Express, does it have to be in C#, could that be the issue? I’m new to VB, I have vb files not cs files. Does that make a difference? Thanks!
@Michel Bujardet, @Tim Hare I was able to create the DLL using Visual Basic in Visual Studio 2012 with “Register for Com interop” and Xojo can Insert it using the Active X references. I can see the public class and create it in Xojo but I can’t access the containing methods to return the data I need to Xojo.
My VB Class is named ReadAInput and the DLL is named GetReading.
VB DLL Class:
[code]Public Class ReadAInput
Dim strResult = GetInput()
Public Function GetInput() As String
Dim mydaqboard As New MccDaq.MccBoard(0)
Dim dataval As System.Int16
Dim engunit As Single
mydaqboard.AIn(0, MccDaq.Range.Bip10Volts, dataval)
mydaqboard.ToEngUnits(MccDaq.Range.Bip10Volts, dataval, engunit)
Xojo can use this code fine:
Dim Input As New GetReading.ReadAInput
The method in the DLL class is called GetInput() and it returns a string, how do I get Xojo to access the method inside the class?