请问那个函数能判断当前的系统是nt还是98?

dirdir 2001-02-10 08:02:00
...全文
228 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
seesi 2001-02-11
  • 打赏
  • 举报
回复
我也来晚了!!!好痛苦。
是啊,应该公平的给分了,要不以后没有兴趣回答问题了。
wildinghorse 2001-02-11
  • 打赏
  • 举报
回复
照理说已经解答完毕,怎么还不给分啊?
舟中夜起 2001-02-11
  • 打赏
  • 举报
回复
BOOL IsNT()
{
OSVERSIONINFO stOSVI;

memset(&stOSVI, NULL, sizeof(OSVERSIONINFO));
stOSVI.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
BOOL bRet = GetVersionEx(&stOSVI);

_ASSERT(TRUE == bRet);

if (FALSE == bRet) return FALSE;
return (VER_PLATFORM_WIN32_NT == stOSVI.dwPlatformId);
}
haor 2001-02-11
  • 打赏
  • 举报
回复
唉,又一个来晚的。。 :(
wildinghorse 2001-02-11
  • 打赏
  • 举报
回复
哈哈,这老兄可真逗的,哈哈
沒有名字 2001-02-10
  • 打赏
  • 举报
回复
唉,来晚了。。 :(
wildinghorse 2001-02-10
  • 打赏
  • 举报
回复
微软的东西都是一个体系的,这样的函数因该是windows me也可以的
ccandc 2001-02-10
  • 打赏
  • 举报
回复
winme可以吗?
wildinghorse 2001-02-10
  • 打赏
  • 举报
回复
GetVersionEx()返回相关的值

OSVERSIONINFO是操作系统的版本
请看下面的东西:

typedef struct _OSVERSIONINFO{
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
TCHAR szCSDVersion[ 128 ];
} OSVERSIONINFO;

Members
dwOSVersionInfoSize
Specifies the size, in bytes, of this data structure. Set this member to sizeof(OSVERSIONINFO) before calling the GetVersionEx function.
dwMajorVersion
Identifies the major version number of the operating system. For example, for Windows NT version 3.51, the major version number is 3; and for Windows NT version 4.0, the major version number is 4.
dwMinorVersion
Identifies the minor version number of the operating system. For example, for Windows NT version 3.51, the minor version number is 51; and for Windows NT version 4.0, the minor version number is 0.
dwBuildNumber
Windows NT: Identifies the build number of the operating system.
Windows 95: Identifies the build number of the operating system in the low-order word. The high-order word contains the major and minor version numbers.

dwPlatformId
Identifies the operating system platform. This member can be one of the following values: Value Platform
VER_PLATFORM_WIN32s Win32s on Windows 3.1.
VER_PLATFORM_WIN32_WINDOWS Win32 on Windows 95 or Windows 98.
For Windows 95, dwMinorVersion is zero.

For Windows 98, dwMinorVersion is greater than zero.

VER_PLATFORM_WIN32_NT Win32 on Windows NT.



szCSDVersion
Windows NT: Contains a null-terminated string, such as "Service Pack 3", that indicates the latest Service Pack installed on the system. If no Service Pack has been installed, the string is empty.
Windows 95: Contains a null-terminated string that provides arbitrary additional information about the operating system


GetSystemInfo()
也可以得到一些相关的信息
自己看吧在msdn上查询
wildinghorse 2001-02-10
  • 打赏
  • 举报
回复
GetVersionEx()

16,550

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Creator Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧