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

Linking on XP when fn ref not available

gelarimer
Beginner
318 Views

I would like to include a call to fn. SetProcessDPIAware(), which is available in the Vista OS but not XP OS. However, I need to compile and link on an XP machine.

The program tests for the Vista OS before calling SetProcessDPIAware(), and the INTEFACE block for SetProcessDPIAware() is included in the IVF program.

Is there a way that an executable IVF program can be generated on XP without producing a link error, and that will still be able to call fn. SerProcessDPIAware() when run on Vista?

Thanks for any comments or information.

0 Kudos
2 Replies
Steven_L_Intel1
Employee
318 Views
You would have to dynamically load the Windows DLL that defines this routine (user32.dll) and then call GetProcAddress to see if it's there. If so, then you can call it. See the sample DynamicLoad for an example of loading a DLL and call ing a procedure in it.
0 Kudos
gelarimer
Beginner
318 Views
Thanks Steve.
0 Kudos
Reply