Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29283 Discussions

Calling API which is not included in Fortran

maciej
Beginner
738 Views
Hello,

It seems that not every Windows API subroutine can be accessed from Fortran. I think that it can be done, however.
Could anyone show an example of AfxEndThread function call from Fortran code?

regards,
Maciej
0 Kudos
1 Solution
Steven_L_Intel1
Employee
738 Views
AfxEndThread is an MFC (Microsoft Foundation Class) routine - it would typically be called from C++. I don't see in the MSDN documentation information on a supplied linkable library it is defined in.

It is true that there are some APIs which COULD be called from Fortran but don't have interfaces supplied. We add these as we can.

View solution in original post

0 Kudos
2 Replies
Steven_L_Intel1
Employee
739 Views
AfxEndThread is an MFC (Microsoft Foundation Class) routine - it would typically be called from C++. I don't see in the MSDN documentation information on a supplied linkable library it is defined in.

It is true that there are some APIs which COULD be called from Fortran but don't have interfaces supplied. We add these as we can.
0 Kudos
anthonyrichards
New Contributor III
738 Views
From what I read on the web, calling AFxEndThread from outside is not a good idea, e.g. "The problem with calling AfxEndThread yourself is that it won't unwind the stack and destroy local variables, which can cause memory leaks for objects". If you want to end a thread, use PostThreadmessage or PostQuitmessage().
0 Kudos
Reply