I'm writing a C++ program using VS2015 (Platform Toolset v140, Target Platform 8.1) on a Windows 10 machine, and my program ran just fine on Windows 7, 8 and 10 up until recently.
After adding touch support using GetPointerInfo()
, I get this pop-up error immediately on execution on Windows 7 machines:
Unable to find an entry point named GetPointerInfo in USER32.dll
MS clearly states that GetPointerInfo()
is only supported on Win8 and up, and that's all right, but I don't want to break my program's compatibility with Windows 7 altogether.
I assume Windows 7's version of USER32.DLL
doesn't containing the function at all, but adding runtime checks in my program (i.e. only calling GetPointerInfo()
if IsWindows8OrGreater()
returns true) doesn't do the trick.
In fact, merely compiling my program with any reference to GetPointerInfo()
will break Win7 compatibility, no matter if the function is actually called or not. The program won't even enter WinMain()
, it just throws me that message and quits.
Again, on Windows 8 and up, everything is working just fine.
How do I solve this?
I have Googled for half a day, but having very little knowledge of DLLs, linker and compiler settings, I obviously don't even know how to phrase my searches because I have come up empty so far.
I have tried both Multi-threaded (/MT) and Multi-threaded DLL (/MD) as my Runtime Library.
I have also tried enabling and disabling Function-Level Linking, but the result remains the same.