Re: another call_external newbie [message #11350 is a reply to message #11348] |
Sun, 22 March 1998 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Donald Green (dfg@ai.mit.edu) writes:
> 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....
The most common reason Call_External fails is that the
C program expects 4 byte integers and it gets passed 2
byte integers. I suspect that is what is going on here.
Try setting the "board" variable to 34L and see if you
don't have better luck. Remember, default IDL integer
variables are SHORT integers in other programming
languages.
Cheers,
David
-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|