I have a situation where i’m working with two DLLs, which are named differently, and communicate with two distinct pieces of hardware. They are from one company and the dlls share some common code libraries.
they have a lot of functions with the same name. I can work with either one, but when I work with both, the functions seem to cross wires even though I can trace my code to see that each one is routed to the correct declare (pointing to the correct DLL).
The hardware vendor tells me that they have their own examples, coded in a different environment, that does not replicate this issue.
I tried aliasing the functions too, but that didn’t work.
Can anyone suggest anything else to look at?
Declare Function LIB1_functionname Lib "Lib1.dll" Alias "functionname" () As Integer
Declare Function LIB2_functionname Lib "Lib2.dll" Alias "functionname" () As Integer
Yes, I will do this.
I’m a bit nervous about the amount of effort to translate my declares to use your plugin. I haven’t made use of your declare functions before.
// change path if you like to try this on Windows or Linux
Dim d As New DeclareLibraryMBS("/usr/lib/libz.1.dylib")
// zlibVersion
// ZEXTERN Const char * ZEXPORT zlibVersion Of((void));
Dim p As ptr = d.Symbol("zlibVersion")
// call via our class:
Dim f As New DeclareFunctionMBS("()Z", p)
Dim n As String = f.Invoke
MsgBox "zlibVersion: "+n
// call via delegate
' define delgate like this:
' Public Function zlibVersionDelegate() As CString
Dim z As New zlibVersionDelegate(p)
Dim v As String = z.Invoke
MsgBox "zlibVersion: "+v
I see that @William_Yu has made a new ticket regarding soft declares and has marked that is fixed (nice) <https://xojo.com/issue/63502>, not really sure why there’s a new ticket when <https://xojo.com/issue/63334> exists, I can only assume that compile time declares aren’t going to be fixed at this time?