函数GetVersionEx声明如下: WINBASEAPI BOOL WINAPI GetVersionExA( __inout LPOSVERSIONINFOA lpVersionInformation ); WINBASEAPI BOOL WINAPI GetVersionExW( __inout LPOSVERSIONINFOW lpVersionInformation ); #ifdef UNICODE #define GetVersionEx GetVersionExW #else #define GetVersionEx GetVersionExA #endif // !U...
sysinfoapi.h 标头将 GetVersionEx 定义为一个别名,该别名根据 UNICODE 预处理器常量的定义自动选择此函数的 ANSI 或 Unicode 版本。 将中性编码别名与不中性编码的代码混合使用可能会导致编译或运行时错误不匹配。 有关详细信息,请参阅函数原型的约定。
#ifdef UNICODE #define GetVersionEx GetVersionExW #else #define GetVersionEx GetVersionExA #endif // !UNICODE lpVersionInformation是返回系统版本的信息。 调用函数的例子如下: #001 // #002 //获取当前登录用户的名称。 #003 //蔡军生 2007/11/14 QQ:9073204 深圳 #004 void GetWinVersion(void) #005 ...
When using theGetVersionExfunction to determine whether your application is running on a particular version of the operating system, check for version numbers that are greater than or equal to the desired version numbers. This ensures that the test succeeds for later versions of the operating system...
ZeroMemory(&si, sizeof(SYSTEM_INFO)); ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi)) ) return 1; // Call GetNativeSystemInfo if supported or GetSystemInfo otherwise. ...
[此函数是 GetVersionEx 函数的包装器。 此函数将来可能会更改或不可用。 应用程序应直接调用 GetVersionEx。]获取有关操作系统版本的信息。 请参阅 GetVersionEx。语法C++ 复制 BOOL _GetVersionEx( ... ); 参数... 要求展开表 要求值 DLL Msmdun80.dll; Sqlunirl.dll 另请参阅...
而GetVersionExA是一个已经过时的函数,不再建议使用。 如果需要替代GetVersionExA函数,建议使用GetFileVersionInfoExW函数。GetFileVersionInfoExW函数可以获得文件的版本信息,并将其存储在内存中的指定缓冲区中。 以下是GetFileVersionInfoExW函数的用法示例: ```C++ #include <Windows.h> #include <iostream>...
A:ANSI。W:Unicode。
A:ANSI。W:Unicode。
sysinfoapi.h 标头将 GetVersionEx 定义为一个别名,该别名根据 UNICODE 预处理器常量的定义自动选择此函数的 ANSI 或 Unicode 版本。 将中性编码别名与不中性编码的代码混合使用可能会导致编译或运行时错误不匹配。 有关详细信息,请参阅函数原型的约定。