c++ - c# How to use the new Version Helper API -


since osversion not reliable since windows 10 has been released (this function reports windows 8 windows 10), i'm attempting use new version helper api functions in c# application. here are.

i apologize if issue dll import, here attempt pull in these new methods detect os correctly.

[dllimport("kernel32.dll", charset = charset.auto)] public static extern bool iswindows7orgreater();  [dllimport("kernel32.dll", charset = charset.auto)] public static extern bool iswindows8orgreater();  [dllimport("kernel32.dll", charset = charset.auto)] public static extern bool iswindows8point1orgreater();  [dllimport("kernel32.dll", charset = charset.auto)] public static extern bool iswindows10orgreater(); 

whenever i'm calling these methods, i'm getting:

exception is: entrypointnotfoundexception - unable find entry point named 'iswindows7orgreater' in dll 'kernel32.dll'.

am doing wrong? have ideas? help!

edit: please see accepted answer , take @ this code project start on porting these methods on c#.

unfortunately, it's little more complicated that. "functions" macros defined in versionhelpers.h.

if think of it, that's way - can't add functions older windows versions retroactively.

you have port macros on c#.


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -