Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29594 Discussions

calling CVF Dll from Delphi 5 using arrays.

sarumugam
Beginner
2,025 Views
I am able to call the CVF dll from Delphi by passing integers - but I am not able to call the dll using arrays. I am making sure stdcall and alias declarations are ensured in the fortran dll. Similarly, by passing the address of the first element in the array from Delphi, I am able to receive it and see it using the watch the command in CVF. I am not able to do any manipulation or operation on that array after getting it into fortran dll.

Any help will be appreciated.

Thanks.

sarumugam
0 Kudos
1 Reply
subyshanky03
Beginner
2,025 Views
I think I have narrowed down where the problem is. I am having problem only when I sent dynamically allocated multi-dimenstional array to fortran dll. In otherwords, If I initialize the array as part of type declaration in delphi and pass the address to fortran. It works. For a dynamically allocated single dimensional array, it works fine with passing the address as Pointer(array_name)^. For multi-dimensional dynamically allocated array, the program fails. Any help on this how to pass dynamically allocated arrays in Delphi will be very much appreciated. I am taking care of transpose of the array when I pass to fortran. SO the issue is with memory allocation in delphi and how to access them in fortran.

Thanks.

Sankar.
0 Kudos
Reply