[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Call_external with V C++

Hi, I am using IDL's call_external function with a DLL I created using
visual c++.  I am having difficulties because the parameters I am passing
are not coming through properly.  I tried to pattern my code based on the
examples in the IDL external folder:

IDL code:


status = call_external(dll,'GenCellsSIRT', sourceFileName, recFileName, $
	initvel, cellLength)

C++ code:

#include "export.h"
#include "defs.h"
void IDL_STDCALL GenCellsSIRT(int argc, void *argv[])

float * vel;
float * cellLength;
IDL_STRING * fn_src_loc;
IDL_STRING * fn_rec_loc;

fn_src_loc=(IDL_STRING *) argv[0];
fn_rec_loc=(IDL_STRING *) argv[1];
vel = (float *) argv[2];
cellLength=(float * ) argv[3];

The problem is that the vel and cellLength values are not received
properly by the C++ code.  Basically I get garbage when I try to
dereference them and print them out or use them.  Any ideas?

Also does anyone know how to keep IDL from keeping the DLL file open.  I
have to close the program each time after I run it so that I can compile
the DLL.

- Lisa A. Lassner

"We cannot do great things on this earth.  We can only do small things
with great love."

-Mother Teresa