[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Call_external with V C++
- Subject: Call_external with V C++
- From: <lalassne(at)Mines.EDU>
- Date: Thu, 17 May 2001 11:53:14 -0600
- Newsgroups: comp.lang.idl-pvwave
- Organization: Colorado School of Mines
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:24974
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:
dll="C:\WINDOWS\Desktop\TomoInvDLL\Debug\TomoInvDLL.dll"
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