Declare Function LoadLibraryA Lib "KERNEL32.DLL" Alias "LoadLibraryA" ( _
ByRef lpLibFileName As Asciiz _ ' __in LPCSTR lpLibFileName
) As DWord ' HMODULE
Dim RetValue As Long
print "test load library"
RetValue = LoadLibraryA("funbasic.dll") ' ("oxygen.dll")
print "RETURN CODE FROM LoadLib: " & Str$(RetValue)
' correct result for oxygen: 12713984
' correct result for powerbasic: 10551296
' if no DLL is found result is "0" (zero)
trace the value returned from LoadLibrary at each stage,
You could bind the interpreted script into the interpreter program as a string resource. Not something I am familiar with, ...
$ FileName "tfun.exe"
'include "..\..\inc\RTL64.inc" 'to compile 64bit
'include "..\..\inc\RTL32.inc" 'to compile 32bit
'extern lib "funbasic.dll"
library "funbasic.dll"
include "funbasic.inc"
dim as sys pProgram
'====================
'EMBEDDED SOURCE CODE
'====================
bstring s 'read only. do not free
'embedfile "source.txt",s
embedfile "01-vlong.bas",s
print s
funbasic_run("01-vlong.bas",s)
print "ok!"