idl dlm [message #36581] |
Wed, 08 October 2003 09:55 |
wroozee
Messages: 2 Registered: October 2003
|
Junior Member |
|
|
hi, i'm new to IDL, so this might be a basic question for all IDL
experts. Any help is greatly appreciated.
I have this .cpp file and i need to call the functions in this file
from IDL.
.cpp file
----------------
#include "ESML.h"
#include "idl_export.h"
void * ESML_CreateObj(const std::string & esmlFile,const std::string &
dataFile)
{
return((void *)new ESML(esmlFile,dataFile));
}
void ESML_DeleteObj(void * esmlObj)
{
delete((ESML *)esmlObj);
}
int IDL_Load(void)
{
/*
* These tables contain information on the functions and procedures
* that make up the TESTMODULE DLM. The information contained in
these
* tables must be identical to that contained in testmodule.dlm.
*/
static IDL_SYSFUN_DEF2 function_addr[] = {
{ (IDL_SYSRTN_GENERIC) ESML_CreateObj, "ESML_CREATEOBJ", 2, 2, 0,
0},
{ (IDL_SYSRTN_GENERIC) ESML_DeleteObj, "ESML_DELETEOBJ", 1, 1, 0,
0}
};
/*
* Register our routine. The routines must be specified exactly the
same
* as in testmodule.dlm.
*/
return IDL_SysRtnAdd(function_addr, IDL_TRUE,
IDL_CARRAY_ELTS(function_addr));
}
.dlm file
-----------------
MODULE esml
DESCRIPTION Test code for loadable modules
VERSION 1.0
SOURCE Research Systems, Inc.
BUILD_DATE OCT 8 2003
FUNCTION ESML_CREATEOBJ 2 2
FUNCTION ESML_DELETEOBJ 1 1
.def file
----------------
LIBRARY esml
DESCRIPTION 'Demonstrates use of IDL Dynamic Loadable Modules'
EXPORTS IDL_Load @1
Thanks,
Wroozee
|
|
|