maybe this helps?
'----------------------------------------------------------------------------
  'thinBasic_FunctionSimpleCall_ByPtr
  '----------------------------------------------------------------------------
  ' Call a script function and optionally returns it value (numeric or string)
  ' This function permits to call script callback functions passing automatic
  ' pseudo callbacks variables 
  ' USE only when in need of a callback function from module
  '----------------------------------------------------------------------------
  Declare Function  thinBasic_FunctionSimpleCall_ByPtr                _
                          Lib "thinCore.DLL"                          _
                          Alias "thinBasic_FunctionSimpleCall_ByPtr"  _
                          (                                          _
                            ByVal FunctionPtr As Long              , _  '---PTR to function returned by thinBasic_FunctionGetPtr or other way
                            Optional                                  _
                            ByVal ptrEXT As Ext Ptr                , _  '---Used to get back from the called function a numeric value
                            ByVal ptrSTR As String Ptr              , _  '---Used to get back from the called function a string value
                            ByVal IsCallBack  As Long              , _
                            ByVal lCBHNDL    As Long              , _
                            ByVal lCBMSG      As Long              , _
                            ByVal lCBCTL      As Long              , _
                            ByVal lCBCTLMSG  As Long              , _
                            ByVal lCBLPARAM  As Long              , _
                            ByVal lCBWPARAM  As Long              , _                                        
                            ByVal lCBNMCODE  As Long              , _                                        
                            ByVal lCBNMHDR    As Long              , _                                        
                            ByVal lCBNMHWND  As Long              , _                                        
                            ByVal lCBNMID    As Long                _                                        
                          ) As Long

 '----------------------------------------------------------------------------
  'thinBasic_FunctionGetPtr
  '----------------------------------------------------------------------------
  '----------------------------------------------------------------------------
  Declare Function  thinBasic_FunctionGetPtr                      _
                          Lib "thinCore.DLL"                      _
                          Alias "thinBasic_FunctionGetPtr"        _
                          (                                      _
                            ByVal fName      As String          _
                          ) As Long
But maybe I'm on the wrong track here...