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

Array of float passed by ref in Visual C#

Deleted_U_Intel
Employee
411 Views
I'm currently porting a working VB6 application in Visual c# but I'm having big troubles converting this external function call to a Fortran DLL.
The VB6 version is
Declare Sub CALC Lib "CALC32.DLL" (ByRef V1 As Single, ByRef V2 As Single)
where V1 is declared as
Public V1(1 To 50) As Single
and V2
Public V2(1 To 100) As Single
In C# I declared

[DllImport("CALC32.DLL")]
static extern void CALC(ref float[] V1, ref float[] V2);

CALC(ref InputData, ref OutputData);

where paramters are declared as

private float[] InputData = new float[50];
private float[] OutputData = new float[100];

When the program call the function itexits without any message.

Any suggestion?

Thanks

Cris

0 Kudos
0 Replies
Reply