comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: another call_external newbie
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: another call_external newbie [message #11347] Mon, 23 March 1998 00:00 Go to previous message
Reinhold Schaaf is currently offline  Reinhold Schaaf
Messages: 10
Registered: March 1998
Junior Member
<HTML>
<TT></TT>&nbsp;<TT></TT>

<P><TT>hdsfkj wrote:</TT>
<BLOCKQUOTE TYPE=CITE><TT>That was it all right.....&nbsp; Thank you.</TT><TT></TT>

<P><TT>David Fanning wrote:</TT><TT></TT>

<P><TT>> Donald Green (dfg@ai.mit.edu) writes:</TT>
<BR><TT>></TT>
<BR><TT>> > Hi, I'm a c programmer trying to implement some IDL for device
control.</TT>
<BR><TT>> > I need help debugging a short IDL program that uses call_external
to</TT>
<BR><TT>> > access routines in a</TT>
<BR><TT>> > dll written in C using VC++5.0 and IDL 5.0. Both code snippets
appear</TT>
<BR><TT>> > below. The problem seems to be</TT>
<BR><TT>> > accessing data passed by reference. The Message statement returns</TT>
<BR><TT>> > garbage but if I check</TT>
<BR><TT>> > the value of 'board' in IDL after the call_external is executed
it's</TT>
<BR><TT>> > value is indeed 1. Why can I change</TT>
<BR><TT>> > the value properly but not access it's value in the C routine?
Thanks</TT>
<BR><TT>> > for any help....</TT>
<BR><TT>></TT>
<BR><TT>> The most common reason Call_External fails is that the</TT>
<BR><TT>> C program expects 4 byte integers and it gets passed 2</TT>
<BR><TT>> byte integers. I suspect that is what is going on here.</TT>
<BR><TT>></TT>
<BR><TT>> Try setting the "board" variable to 34L and see if you</TT>
<BR><TT>> don't have better luck. Remember, default IDL integer</TT>
<BR><TT>> variables are SHORT integers in other programming</TT>
<BR><TT>> languages.</TT>
<BR><TT>></TT>
<BR><TT>> Cheers,</TT>
<BR><TT>></TT>
<BR><TT>> David</TT>
<BR><TT>> -----------------------------------------------------------</TT >
<BR><TT>> David Fanning, Ph.D.</TT>
<BR><TT>> Fanning Software Consulting</TT>
<BR><TT>> E-Mail: davidf@dfanning.com</TT>
<BR><TT>> Phone: 970-221-0438</TT>
<BR><TT>> Coyote's Guide to IDL Programming: <A HREF="http://www.dfanning.com/">http://www.dfanning.com/</A></TT></BLOCKQUOTE>
<TT></TT>

<P><TT>I am also developing programs with VC++50 and IDL and found the
following feature of VC++ helpfull:</TT><TT></TT>

<P><TT>Under VC++, select Projects..projects settings..Debug. Specify idlde.exe
(with full path) as "executable for debug session" (and also a working
directory if necessary). With these settings, running the debugger of VC++
starts a IDL session, allowing you to load, edit, compile, and run your
IDL program. Setting (IDL-) breakpoints outside and (VC++) breakpoints
inside your dll gives you a good tool for debugging your IDL-VC++ interface.</TT><TT></TT>

<P><TT>Servus,</TT><TT></TT>

<P><TT>Reinhold</TT>
<BR><TT></TT>&nbsp;<TT></TT>

<P><TT>--</TT>
<BR><TT> ************************************************************ * </TT>
<BR><TT>&nbsp;Reinhold Schaaf</TT>
<BR><TT>&nbsp;Ettighofferstr. 22</TT>
<BR><TT>&nbsp;53123 Bonn</TT>
<BR><TT>&nbsp;Germany</TT><TT></TT>

<P><TT>&nbsp;Tel.:&nbsp; 0049-228-625713</TT>
<BR><TT>&nbsp;Email: schaaf@astro.uni-bonn.de</TT>
<BR><TT> ************************************************************ * </TT>
<BR>&nbsp;</HTML>
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Removing CRLF from a String
Next Topic: Programming Books Available Again

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 18:16:52 PDT 2025

Total time taken to generate the page: 0.32019 seconds