I'm not certain what I'm doing incorrectly. The external function calls "succeed" (has the desired effect, returns data, etc.), but at the end of the handler, LO crashes.
Here's the BASIC macro I have.
Code: Select all
Declare Function _myfunc Lib "path\to\my.dll" Alias "myfunc" (ByVal inst as Integer) as Integer
Function myFunc(ByVal x as Integer) as Integer
Dim rc as Integer
rc = _myfunc(x)
myFunc = rc
End Function
Sub ButtonHandler(oEvent)
Print myFunc(0)
FreeLibrary "path\to\my.dll"
End Sub
Thanks.