I am trying to call an unmanaged C# DLL from Xojo with a double/float data type. I have tried several declarations of the variables but the value is never returned properly:
From C# project:
[DllExport(“SampleFunction1”, CallingConvention = CallingConvention.Cdecl)]
//Tried this:
public static Int32 SampleFunction1(float _L)
//Tried this:
public static Int32 SampleFunction1(ref float _L)
From Xojo/RB project:
//Tried this:
Declare Function SampleFunction1 Lib “MyLibrary.dll” (_L As Double) As Integer
//Tried this:
Declare Function SampleFunction1 Lib “MyLibrary.dll” (byref _L As Double) As Integer
dim L As Double
dim result As Integer = SampleFunction1(L)
The value is never passed back to Xojo/RB successfully - it’s always 0.