Calling Method
The functions can be called with mdlCExpression_ getValue(). The code example below illustrates the method:
void Example( void)
{
_int64 (*FnScanGetPnt)( Point3d **) ;
Point3d *Pnt ;
_int64 Sct ;
// Get function pointer
ScanFuncAddr((void **) &FnScanGetPnt, "FnScanGetPnt") ;
if (!FnScanGetPnt) return (0) ;
Sct = FnScanGetPnt( &Pnt) ;
printf( “%I64d points loaded into TerraScan”, Sct) ;
}
// ==================================================================
// Get pointer to function in TerraScan.
// ==================================================================
int ScanFuncAddr( void **Fp, char *Func)
{
HMODULE Hdl ;
void *Ptr ;
*Fp = NULL ;
Hdl = GetModuleHandle( "tscan.dll") ;
if (!Hdl) return (0) ;
Ptr = GetProcAddress( Hdl, Func) ;
if (!Ptr) return (0) ;
*Fp = Ptr ;
return (1) ;
}