I am trying to create a single executable of a simple Win32 application that has to be able to run on both Windows XP and Windows Vista/2008.
Due to some changes in the way Vista works some extra Win32 API calls have to be made to make the program function correctly as it did on XP.
Currently I detect if the application is running on a Windows version newer than XP and call the extra win32 functions as needed. This works fine when running on Vista and Server 2008 but fails when running on Windows XP.
On Windows XP when the program starts I get the error message: The procedure entry point ShutdownBlockReasonCreate could not be located in they dynamic link library USER32.DLL. This happens before any of my code starts executing and none of the code paths when running on XP should call that function.
I would really like to just have one executable that works on both XP and Vista. If possible I dont want to have to have conditional compilation and have two executables.
What is the best way to solve this issue?