another call_external newbie [message #11352] |
Sun, 22 March 1998 00:00 |
hdsfkj
Messages: 12 Registered: March 1998
|
Junior Member |
|
|
Hi, I'm a c programmer trying to implement some IDL for device control.
I need help debugging a short IDL program that uses call_external to
access routines in a
dll written in C using VC++5.0 and IDL 5.0. Both code snippets appear
below. The problem seems to be
accessing data passed by reference. The Message statement returns
garbage but if I check
the value of 'board' in IDL after the call_external is executed it's
value is indeed 1. Why can I change
the value properly but not access it's value in the C routine? Thanks
for any help....
Donald Green
dfg@ai.mit.edu
pro test
PRINT, "This program tests CALL_EXTERNAL using test.dll"
value = 6.459
board = 34
lResult = CALL_EXTERNAL('c:\testidl\testidl.dll','test',board,value)
PRINT, "Test one complete."
end
LONG WINAPI test(LONG argc, LPVOID argv){
CHAR szMsg[256];
LPLONG argarray = (LPLONG) argv;
LPINT boardnum = (LPINT)argarray[0];
LPFLOAT val = (LPFLOAT)argarray[1];
sprintf(szMsg, "%i %f",*boardnum,*val);
MessageBox (NULL, (LPSTR)szMsg, (LPSTR)"Reply from test.dll",
MB_OK | MB_ICONINFORMATION);
*boardnum = 1;
return(1);
}
|
|
|