Ciao Charles,
I'm trying to use Oxygen to develop thinBasic modules.
I have problem calling from a PowerBasic program a function inside an Oxygen DLL having just the function pointer.
Here the example and attached the needed files to test.
Do not know what I'm doing wrong, maybe it is just under my nose
Oxygen source of the DLL.
GiveMeTheFunctionPTR is exported and is used to pass to the PB executable the pointer to Exec_Hello function
'
$dll
$filename "Call_DWORD_Hang.dll"
#include "..\..\inc\RTL32.inc"
'----------------------------------------------------------------------------
Function GiveMeTheFunctionPTR() As sys Export
Function = (@Exec_Hello)
end function
function Exec_Hello() as long
print "Hello"
end function
PowerBasic source of executable calling the DLL.
It calls GiveMeTheFunctionPTR from the DLL and if ok, it will CALL DWORD ... using a function template
It hangs at CALL DWORD ... #Compile Exe
Declare Function Exec_CODEPTR_ReturnLong() As Long
Declare Function GiveMeTheFunctionPTR Lib "Call_DWORD_Hang.dll" Alias "GiveMeTheFunctionPTR" () As Dword
Function PBMain() As Long
Local pFun As Dword
Local tmpReturnCodeLong As Long
pFun = GiveMeTheFunctionPTR()
MsgBox "Pointer to function is:" & Str$(pFun)
If pFun Then
MsgBox "Before calling"
Call Dword pFun Using Exec_CODEPTR_ReturnLong() To tmpReturnCodeLong
MsgBox "After calling"
End If
End Function
Thanks a lot for any help.
Ciao
Eros