简体   繁体   中英

Can Fortran interact with Silverlight, WPF, or MFC on Windows?

I'd like to use Fortran to solve a numerical problem, but I'm not sure using a Fortran GUI library is the best choice to visualize the results. How feasible is it to have a GUI in Silverlight, WPF, or maybe MFC and call code written in Fortran? Of course the Silverlight and/or WPF code would be written in a .NET language, and if I went with MFC it would be in C++.

Provided you use the standard Fortran means of making your subroutines that is usable via C , you should be able to use P/Invoke from C# to access and call them. With MFC, you could call the subroutines directly.

This will work for MFC and WPF (but not Silverlight). If you want to use this from Silverlight, you'll either need to wait for SL 5 (for P/Invoke support) or wrap the type in a COM library.

Alternatively to what Reed Copsey mentioned you can use Fortran compiler which can produce .NET assemblies. For example, Silverfrost FTN95 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM