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

Home » Public Forums » archive » Array has a corrupted descriptor
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: Array has a corrupted descriptor [message #58702 is a reply to message #25164] Tue, 12 February 2008 10:00 Go to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Tue, 12 Feb 2008, zhouqiang.search@gmail.com wrote:

> HI , folks
>
> I try to complete a program with IDL invoking some function from
> C ,it works well when I passing a float , double
> array , and return a same type with input . Now there is a problem
> that it didn't work while passing a complex array.
> And the error "array has a corrupted descriptor" every time. I am a
> newer with IDL , and I don't know too much
> about that , if anyone can help me, please accept my wonderful
> appreciate.
>
> -----------------------c program-----------------------
> DLLIMPORT void array_test(int argc, void *argv[])
> {
> int nr = *(int *) argv[0];
> int ni = *(int *) argv[1];
>
> // int *result = argv[2];
> IDL_DCOMPLEX *result = argv[2];
> int i , j;
> for(i = 0;i< ni ; i++)
> {
> for(j=0;j<nr;j++)
> {
>
> result[i*ni+j].r = 5 ;
> result[i*ni+j].i = 10 ;

^^^^^^
Try i*nr+j

regards,
lajos


> }
> }
>
> }
>
> ----------------IDL program---------------------
>
>
> function test1 , row , line
> ; result= lonarr(row,line)
> result = complexarr(row , line)
> s = call_external('C:\_test\test3\Project3.dll', 'array_test',row ,
> line , result)
> return, result
> end
>
> pro test
> ;p=lonarr(5,5)
> p = complexarr(5,5)
> p = test1(5,5)
> print , p
> end
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Object as a member to object/class
Next Topic: Get index from table widget

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

Current Time: Sat Oct 11 00:11:49 PDT 2025

Total time taken to generate the page: 0.08646 seconds