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

Home » Public Forums » archive » how to pass array from dll into IDL?
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
how to pass array from dll into IDL? [message #25656] Thu, 05 July 2001 07:53 Go to next message
maxschautzer is currently offline  maxschautzer
Messages: 2
Registered: July 2001
Junior Member
Hi ,

I need to pass a bytearray from the dll to IDL (5.2).
I am writing a wrapper for a framegrabber which uses the dll functions to aquire
the single frames(monochrome).

Then I try to pass the pointer address to idl, then this address seems not to work.
Here my example:

in dll:

IDL_LONG TestFunction(int argc, void* argv[])
{
IDL_LONG *answer;
BYTE b=255; //BYTE is UCHAR
BYTE *pb;
answer = (IDL_LONG *)argv[0];
pb=&b;
*answer = (IDL_LONG)pb;
return(0L); //Return zero if all okay
}

in IDL:

a=10L
err=Call_External('aquire.dll','TestFunction',a)
print,a
IDL>10415668

This address seems not to be the address for b in dll. I tested this with:
var = EXTPROC_DEREF(addr,BYTE=1)
print,var
IDL>94 not 255
-> EXTPROC_DEREF comes from http://www.rlkling.com/

So her are my questions: How can I access these different address spaces?
How can I test this address in IDL?
Is there any possibility to transfer whole arrays(frames)?
And if, how fast can I get these arrays(25ms)?

Thanks

Max
Re: how to pass array from dll into IDL? [message #25698 is a reply to message #25656] Tue, 10 July 2001 07:45 Go to previous message
david[2] is currently offline  david[2]
Messages: 100
Registered: June 2001
Senior Member
maxschautzer@my-deja.com writes:

> IDL_ImportArray() is hard to find in IDL Online Help ->IDL External Development
> Guide.

Keeps the rift-raft out. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: how to pass array from dll into IDL? [message #25699 is a reply to message #25656] Tue, 10 July 2001 07:31 Go to previous message
maxschautzer is currently offline  maxschautzer
Messages: 2
Registered: July 2001
Junior Member
Thanks for your advice!

IDL_ImportArray() is hard to find in IDL Online Help ->IDL External Development
Guide.

Max Schautzer
Re: how to pass array from dll into IDL? [message #25704 is a reply to message #25656] Tue, 10 July 2001 02:27 Go to previous message
nmw is currently offline  nmw
Messages: 18
Registered: January 1995
Junior Member
In article <3B465516.C851CAB4@home.com>, Randall Frank <rjfrank1@home.com> writes:
> Nigel,
> Make sure you supply a free_cb function in your example.
>
> The line:
>
> array = IDL_ImportArray(1, dims, IDL_TYP_BYTE, data, NULL, NULL);
>
> should read something like:
>
> array = IDL_ImportArray(1, dims, IDL_TYP_BYTE, data,
> (IDL_ARRAY_FREE_CB)free, NULL);
>
> to avoid a memory leak in your example.
>
> FWIW.
>

Very good point!

--
-----------------------------------------------------------
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 2523568, Fax : +44 (0)116 2523555
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: angles from rotation matrix
Next Topic: Looking for IDL code to read Excel spreadsheet

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

Current Time: Wed Oct 08 13:18:43 PDT 2025

Total time taken to generate the page: 0.00510 seconds