Joe Caverly
25-01-2024, 14:23
Well, I have configured thinBasic to use PowerBasic for creating a DLL, instead of FreeBasic.
'---Load Console Module
uses "Console"
#Compiled Language = PowerBasic
sub SayHelloFromPowerBasic cdecl alias "SayHelloFromPowerBasic" (byref sMessage as string) export
'#COMPILER PBWIN 10
dim hWin as LONG
TXT.WINDOW(EXE.Name$, 10, 10, 25, 80) TO hWin
TXT.PRINT sMessage
TXT.PRINT "EXE.Full$: ";
TXT.PRINT EXE.Full$
TXT.PRINT "Press a key to close this window"
TXT.WAITKEY$
TXT.END
end sub
#EndCompiled
' Thanks to thinBASIC autodetection,
' the PowerBasic function is discovered automatically
SayHelloFromPowerBasic("Hello, BASIC")
printl "Press a key to end..."
waitKey
This works as it should,
and presents many a possibility.
Joe
'---Load Console Module
uses "Console"
#Compiled Language = PowerBasic
sub SayHelloFromPowerBasic cdecl alias "SayHelloFromPowerBasic" (byref sMessage as string) export
'#COMPILER PBWIN 10
dim hWin as LONG
TXT.WINDOW(EXE.Name$, 10, 10, 25, 80) TO hWin
TXT.PRINT sMessage
TXT.PRINT "EXE.Full$: ";
TXT.PRINT EXE.Full$
TXT.PRINT "Press a key to close this window"
TXT.WAITKEY$
TXT.END
end sub
#EndCompiled
' Thanks to thinBASIC autodetection,
' the PowerBasic function is discovered automatically
SayHelloFromPowerBasic("Hello, BASIC")
printl "Press a key to end..."
waitKey
This works as it should,
and presents many a possibility.
Joe