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

Home » Public Forums » archive » LINKIMAGE problem (beginner)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
LINKIMAGE problem (beginner) [message #11210] Sat, 07 March 1998 00:00
Reinhold Schaaf is currently offline  Reinhold Schaaf
Messages: 10
Registered: March 1998
Junior Member
<HTML>
<TT>Hi there,</TT><TT></TT>

<P><TT>I want an IDL program call C subroutines. Since the CALL_EXTERNAL
mechanism seems to provide no possiblities for typechecking (?) I want
to use LINKIMAGE, where typechecking can (and must) be done. Everything
is pretty nasty (I really don't like pointers on pointers on pointers ...),
but anyway.</TT><TT></TT>

<P><TT>What I could not find out by myself is:</TT><TT></TT>

<P><TT>How can I create (in my C program) a (IDL-) scalar variable of any
type, that is set to something and returned to IDL. I tried something like:</TT><TT></TT>

<P><TT>#include "export.h"</TT>
<BR><TT>#include "Linktest.h"</TT><TT></TT>

<P><TT>IDL_VPTR margins(int argc, IDL_VPTR argv[])</TT>
<BR><TT>{</TT><TT></TT>

<P><TT>&nbsp; IDL_VPTR pvResult = IDL_Gettmp();</TT>
<BR><TT>&nbsp; pvResult = IDL_CvtDbl(1, &amp;pvResult);</TT>
<BR><TT>&nbsp; return(pvResult);</TT>
<BR><TT>&nbsp;</TT>
<BR><TT>}</TT>
<BR><TT></TT>&nbsp;<TT></TT>

<P><TT>which should (in my understanding) create a temporary scalar of
type undefined, convert it to double, and return it back to IDL.</TT><TT></TT>

<P><TT>However, after linking everything in with</TT><TT></TT>

<P><TT>LINKIMAGE, 'MARGINS', 'Linktest.dll', 1, 'margins', $</TT>
<BR><TT> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MAX_ARGS=0, MIN_ARGS=0</TT><TT></TT>

<P><TT>(I am working under NT)</TT><TT></TT>

<P><TT>and calling the function with</TT><TT></TT>

<P><TT>x = margins()</TT><TT></TT>

<P><TT>IDL responds:</TT><TT></TT>

<P><TT>% MARGINS: Variable is undefined: &lt;UNDEFINED>.</TT>
<BR><TT>% Execution halted at:&nbsp; $MAIN$</TT>
<BR><TT></TT>&nbsp;<TT></TT>

<P><TT>I tried some variants of the above, none worked.</TT><TT></TT>

<P><TT>Any help?</TT>
<BR><TT></TT>&nbsp;<TT></TT>

<P><TT>Thanks</TT><TT></TT>

<P><TT>Reinhold</TT><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-0228-625713</TT>
<BR><TT>&nbsp;Email: schaaf@astro.uni-bonn.de</TT>
<BR><TT> ************************************************************ * </TT>
<BR><TT><FONT SIZE=-1></FONT></TT>&nbsp;</HTML>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL 5.0 PLOT or DEVICE bug: hidden graphics buffering?
Next Topic: Time test on SGI Octane

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

Current Time: Wed Oct 08 19:51:00 PDT 2025

Total time taken to generate the page: 0.15891 seconds