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

Home » Public Forums » archive » CALL_EXTERNAL
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: CALL_EXTERNAL [message #31530 is a reply to message #1268] Fri, 19 July 2002 15:00 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"Ian Dean" <Ian.d.dean@baesystems.com> writes:

> Hi,
> I'm running IDL 5.4 under VMS (!!!), and would like some help using
> CALL_EXTERNAL to a C routine.
>
> The C routine has a sinle parameter passed to it, but it is a structure
> (similar to that below)
> The routine returns to the caller a variable sized array starting at the
> address of item buffer and the number of elements in buff_size. (Other
> control fields are also used but I won't cloudy the water with these).

The answer to your question is simple. You can't use CALL_EXTERNAL to
pass IDL structures to an external routine. In fact, I don't believe
you can do this with the DLM or LINK_IMAGE facilities either. IDL
structures are intentionally a black box not meant to be interrogated.

Also, it's not as straightforward as you think to pass raw memory,
such as your "void *buffer", to and from IDL. You'll have to
investigate the External Developers Guide and find out how to insert
user data into an IDL variable.

The much easier approach is to make two wrapper routines, written in
both IDL and C. On the IDL side, this routine would transfer IDL
structure values into simple IDL variables which can then be passed
easily to CALL_EXTERNAL. On the C side, you would need a similar
wrapper which would pack those values back into your own C structure,
and proceed on your merry way.

Good luck,
Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: problems accessing Ken Bowman's IDL page?
Next Topic: Re: From tvscale to cgImage, puzzling feature in the plot

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

Current Time: Wed Oct 08 12:29:13 PDT 2025

Total time taken to generate the page: 0.00427 seconds