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 #31524 is a reply to message #1268] Sat, 20 July 2002 06:25 Go to previous messageGo to previous message
ronn is currently offline  ronn
Messages: 123
Registered: April 1999
Senior Member
in article onofd3ml8d.fsf@cow.physics.wisc.edu, Craig Markwardt at
craigmnet@cow.physics.wisc.edu wrote on 7/19/02 6:00 PM:

>
>
> "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.
>
Hi Ian,

Craig is correct in that you can't use CALL_EXTERNAL to pass a structure,
but you CAN use a DLM to do it. The details are in my "IDL calling C" book,
but the trick is to create a structure in C and mimick it exactly on the IDL
side. This means IDL ints must be C shorts, etc.

I also agree that you don't want to pass raw memory from C to IDL. IDL just
doesn't know what to do with a memory address. Instead you would want to
create an IDL structure on the C side and fill one of the fields with your
data. Then you can use the structure in IDL just like normal.

Hope that helps a little.

-Ronn


--
Ronn Kling
KRS, inc.
email: ronn@rlkling.com
"Application Development with IDL"� programming book updated for IDL5.5!
"Calling C from IDL, Using DLM's to extend your IDL code"!
http://www.rlkling.com/
[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:09 PDT 2025

Total time taken to generate the page: 0.00442 seconds