Array has a corrupted descriptor [message #58704] |
Tue, 12 February 2008 09:41 |
zhouqiang.search
Messages: 6 Registered: February 2008
|
Junior Member |
|
|
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 ;
}
}
}
----------------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
|
|
|