|
- #include<Windows.h>
- #include<tchar.h>
- #include<VersionHelpers.h>
- int WINAPI _tWinMain(HINSTANCE hinstance, HINSTANCE previnstance, LPTSTR lpCmdLine, int nCmdShow)
- {
- BOOL GetVersionEx(LPOSVERSIONINFO lpVersionInfo);
- OSVERSIONINFO vi = { sizeof(vi) };
- ::GetVersionEx(&vi);
- if(vi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
- {
- MessageBox(NULL, _T("您的系统是windows98系列的操作系统"), _T("提示"), MB_OK);
- //CloseHandle(Ret);
- }
- else
- {
- //DWORD ERRORNUM = GetLastError();
- MessageBox(NULL, _T("您的系统是windowsNT系列操作系统"), _T("提示"), MB_OK);
- }
- return 0;
复制代码
这样写了,可是报错啊,为什么呢
1>------ 已启动生成: 项目: MyFirstApp, 配置: Debug Win32 ------
1>MyFirstApp.cpp
1>E:\Program\MyFirstApp\MyFirstApp.cpp(7,7): error C2373: “GetVersionExW”: 重定义;不同的类型修饰符
1>D:\Windows Kits\10\Include\10.0.17763.0\um\sysinfoapi.h(387): message : 参见“GetVersionExW”的声明
1>E:\Program\MyFirstApp\MyFirstApp.cpp(9,4): error C2065: “GetVersionExW”: 未声明的标识符
1>已完成生成项目“MyFirstApp.vcxproj”的操作 - 失败。
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ========== |
上一篇: 怎么不对呀,求讲解下一篇: 关于DLL编程
|