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

Home » Public Forums » archive » Re: Importing data from C/C++ to IDL when type is only known at runtime
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: Importing data from C/C++ to IDL when type is only known at runtime [message #48552 is a reply to message #48492] Tue, 02 May 2006 01:33 Go to previous message
Nigel Wade is currently offline  Nigel Wade
Messages: 286
Registered: March 1998
Senior Member
kathryn.ksm@gmail.com wrote:

> Hi Nigel,
>
> Thanks so much for taking the time to respond to my post and suggest a
> solution. I have started playing around with what you suggest and it
> looks promising, although a bit unpleasant and error-prone, as you say.
> Thanks for clarifying how the IDL_ImportArray function works. It
> would have taken me much longer to figure all of this out on my own!
>

Getting external data into IDL can be a minefield. Probably the two worst things
to get right are dynamic arrays of structures and arrays within structures.

The mapping of an IDL structure to a C structure is fairly trivial, provided you
know what you are doing. You need to be sure you understand the internal
padding in the structures, and be aware that the code may well not work on a
different platform. For dynamic structures the same mapping can always be
achieved with pointers, but this is even more error prone, and a lot more care
has to be taken with padding as you have to do this every time, during
execution, rather than just once in the design.

The documentation in the IDL External Ref Guide is pretty comprehensive, but the
relevant details you need are not always easy to find. It can be quite "chatty"
at times, and vital pieces of information are often hidden away in the middle
of sentences buried in a discussion of some esoteric flag. It pays to read the
section on IDL types and variables in it's entirety, several times, to make
sure you've found all there is in there.

--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: map_set stereographic projection
Next Topic: IDL licensing question

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

Current Time: Thu Oct 09 07:52:10 PDT 2025

Total time taken to generate the page: 0.64397 seconds