Hi George,
first of all, thanks to be here in thinBasic community forum.
I'm sorry but the actual status of thinBasic is not perfect for embedding into 3rd party applications.
But together maybe we will be able to add all the necessary/wished functionalities.
Regarding the 3 main functions, I will document in next thinBasic release.
Here below an example (using PowerBasic as programming language) that should gives you an idea.
Let me know.
Eros
...
Local hLib_thinCore As Long 'Handle of thinCore.dll library
Local hProc_thinBasic_Init As Long 'Handle to Init function
Local hProc_thinBasic_Run As Long 'Handle to Run function
Local hProc_thinBasic_Release As Long 'Handle to Release function
Local lRet As Long
'---Open and load thinCore.dll library
hLib_thinCore = LoadLibraryA( ByCopy "thinCore.Dll" )
'---If all went fine
If hLib_thinCore Then ...
'---Try to load Init, Run, Release functions
hProc_thinBasic_Init = GetProcAddress(hLib_thinCore, ByCopy "thinBasic_Init" )
hProc_thinBasic_Run = GetProcAddress(hLib_thinCore, ByCopy "thinBasic_Run" )
hProc_thinBasic_Release = GetProcAddress(hLib_thinCore, ByCopy "thinBasic_Release" )
'---If all went fine ...
If hProc_thinBasic_Init And _
hProc_thinBasic_Run And _
hProc_thinBasic_Release Then
'---Initialise all necessary variables
Call Dword hProc_thinBasic_Init Using thinBasic_Init( _
0& , _ 'Future usage
hCurInstance, _ 'Instance passed from OS to the application usually in Main function
"thinBasic" _ 'Always pass "thinBasic" string
) To lRet
'---If all went fine ...
If lRet >= 0& Then
'---Run the program
Call Dword hProc_thinBasic_Run Using _
thinBasic_RUN( _
0& , _ 'Will be used in future release
sEmbedded_Script_Main , _ 'File name or string Buffer
%thinBasic_BufferType_IsScript , _ '0 = previous string is a File Name, 1 = previous string is a string Buffer
0 , _ 'Options, set it to zero
%FALSE , _ 'Debug Mode %TRUE/%FALSE
%FALSE , _ 'Log Mode %TRUE/%FALSE
%FALSE , _ 'Obfuscate Mode %TRUE/%FALSE
1& , _ 'Calling Program 1=thinBasic, 2=Console
%FALSE _ 'Dependancy Mode %TRUE/%FALSE
) To lRet
'---Unload all modules, release all memory
Call Dword hProc_thinBasic_Release Using thinBasic_Release( _
0& _ 'Will be used in future release
) To lRet
End If
End If
'---Free loaded thinCore library
FreeLibrary(hLib_thinCore)
End If