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

CVF to IVF conversion & passing strings

erik_warren
Beginner
497 Views

I am converting a Fortran dll created with cvf 6.6 to ivf 10.0.

This dll is called from VB.NET.

In VB.NET I pass the string byval followed immediately by the length of the stringpassed byref. This arrangement works fine with the fortran dll compiled with cvf or with ivf when I set the iface:cvf compiler option.

What would I change Fortran wise and VB.NET wise in order to not use the iface:cvf compiler option?

I tried just passing the strings byref with no string lengths and this "seems" to work but when I run my vb code in debug mode every time a fortran call returns I get a PInvokeStackImbalance error.

Debugging from the Fortran side goes without a hitch.

Each sub exposed in my Fortran dll uses:

!DEC$ ATTRIBUTES STDCALL, REFERENCE, DLLEXPORT ::

Do I need to drop the STDCALL?

Thanks,

Erik

0 Kudos
1 Reply
Steven_L_Intel1
Employee
497 Views
Keep the STDCALL and add MIXED_STR_LEN_ARG to the list of attributes.
0 Kudos
Reply