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

Mixed Language Programming: C#, C++, and FORTRAN

Ibrahim_K_
New Contributor I
205 Views

Dear Friends;

I spend some time to develop an easy and consistent way to call C++/FORTRAN (DLL) from a Windows (WPF) main application which has its own console as well as a Windows GUI. The attached document describes the procedure I was able to use to achieve this. If there is any interest, I can post the source code or VS 2017 solution files as well.

i. konuk

0 Kudos
4 Replies
JAlexiou
New Contributor I
205 Views

Just so I can understand you created a middle tier of C++/CLI such that you can add the Fortran code as a reference assembly instead of using `[DllImport()]` and hoping to get the arguments correct and not corrupt the stack. Kudos, this is really good work here.

Ibrahim_K_
New Contributor I
205 Views

Thanks.

Yes, indeed no DLLImport. All calls across the C# to C++/FORTRAN boundary are from Managed-To-Managed.

Yavuz_D_
Beginner
205 Views

İbrahim, Thanks for the attachment. Saved a lot for me.

Ibrahim_K_
New Contributor I
205 Views

Yavuz:

 

You are most welcome. Happy New Year!

i. konuk

Reply