在第四章输出文字的那个sysmets1.c/.h,我运行了一下,出现了以下错误
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(258) : error C2065: 'SM_MOUSEWHEELPRESENT' : undeclared identifier
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(258) : error C2099: initializer is not a constant
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(258) : warning C4047: 'initializing' : 'int ' differs in levels of indirection from 'char [21]'
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(259) : error C2065: 'SM_XVIRTUALSCREEN' : undeclared identifier
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(259) : error C2099: initializer is not a constant
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(259) : warning C4047: 'initializing' : 'int ' differs in levels of indirection from 'char [24]'
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(261) : error C2065: 'SM_YVIRTUALSCREEN' : undeclared identifier
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(261) : error C2099: initializer is not a constant
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(263) : error C2065: 'SM_CXVIRTUALSCREEN' : undeclared identifier
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(263) : error C2099: initializer is not a constant
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(263) : warning C4047: 'initializing' : 'int ' differs in levels of indirection from 'char [19]'
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(265) : error C2065: 'SM_CYVIRTUALSCREEN' : undeclared identifier
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(265) : error C2099: initializer is not a constant
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(265) : warning C4047: 'initializing' : 'int ' differs in levels of indirection from 'char [22]'
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(267) : error C2065: 'SM_CMONITORS' : undeclared identifier
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(267) : error C2099: initializer is not a constant
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(269) : error C2065: 'SM_SAMEDISPLAYFORMAT' : undeclared identifier
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(269) : error C2099: initializer is not a constant
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(269) : warning C4047: 'initializing' : 'int ' differs in levels of indirection from 'char [21]'
Error executing cl.exe.我首先查了一下MSDN,发现这几个flag都是有的,而且拼写也没错
我直接在出错的SM_**上go to definition,但是没出现WINUSER.h
在没提示出错的SM_**上这样操作却出现了定义宏
于是我看了一下#IFNDEF等条件编译,发现了它有条件限制,即WINVER现在的问题是: (1)大家运行这个代码时有错吗?运行时是不是要配置一下?我用VC6.0
(2)是不是直接在WINUSER.h中修改WINVER呢?还是GUI中有配置?或者不是这种解决思路
我是VC新手,大家帮帮忙,谢谢了
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(258) : error C2065: 'SM_MOUSEWHEELPRESENT' : undeclared identifier
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(258) : error C2099: initializer is not a constant
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(258) : warning C4047: 'initializing' : 'int ' differs in levels of indirection from 'char [21]'
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(259) : error C2065: 'SM_XVIRTUALSCREEN' : undeclared identifier
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(259) : error C2099: initializer is not a constant
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(259) : warning C4047: 'initializing' : 'int ' differs in levels of indirection from 'char [24]'
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(261) : error C2065: 'SM_YVIRTUALSCREEN' : undeclared identifier
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(261) : error C2099: initializer is not a constant
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(263) : error C2065: 'SM_CXVIRTUALSCREEN' : undeclared identifier
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(263) : error C2099: initializer is not a constant
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(263) : warning C4047: 'initializing' : 'int ' differs in levels of indirection from 'char [19]'
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(265) : error C2065: 'SM_CYVIRTUALSCREEN' : undeclared identifier
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(265) : error C2099: initializer is not a constant
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(265) : warning C4047: 'initializing' : 'int ' differs in levels of indirection from 'char [22]'
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(267) : error C2065: 'SM_CMONITORS' : undeclared identifier
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(267) : error C2099: initializer is not a constant
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(269) : error C2065: 'SM_SAMEDISPLAYFORMAT' : undeclared identifier
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(269) : error C2099: initializer is not a constant
f:\sw\c_cpp\cpp\windows_prog\sysmets1\sysmets1.h(269) : warning C4047: 'initializing' : 'int ' differs in levels of indirection from 'char [21]'
Error executing cl.exe.我首先查了一下MSDN,发现这几个flag都是有的,而且拼写也没错
我直接在出错的SM_**上go to definition,但是没出现WINUSER.h
在没提示出错的SM_**上这样操作却出现了定义宏
于是我看了一下#IFNDEF等条件编译,发现了它有条件限制,即WINVER现在的问题是: (1)大家运行这个代码时有错吗?运行时是不是要配置一下?我用VC6.0
(2)是不是直接在WINUSER.h中修改WINVER呢?还是GUI中有配置?或者不是这种解决思路
我是VC新手,大家帮帮忙,谢谢了
解决方案 »
- 请看看这个文件流操作,为何会发生堆被损坏
- 我用SDK写了个关机和重启电脑程序,发现小问题
- 列表控件能多页显示吗?
- 怎样得到鼠标在CPicture 控件中的位置
- 急需显示数据库的控件!!!!!!!
- 出错,怎么可以设置 “上,中(左,右),下”结构得帧呢????
- visibroker4.5的编译问题!!!一定要看呀!!!
- 急问:关于SetTimer的问题
- GetKeyState(CTRL键)&0x8000 是什么意思,请给解释~~~~~~~`
- VC出问题了
- 选择Extended Combo Box下拉菜单中的位图后 上面的无法显示位图 选择的位图也变成白色 这是为什么~~ 期待高手的出现~~
- recv收到一个结构体后,只能读出第一个成员变量,第二个丢失了
#define WINVER 0x0500
#define WINVER 0x0500如果还不行去微软下载新的SDK安装下
#ifdef WINVER
#undef WINVER
#endif
#define WINVER 0x0500
就行了。
WINVER这个常量究竟有什么用?可以指点一下吗?
OTE: WINVER has been defined as 0x0500 or greater which enables
Windows NT 5.0 and Windows 98 features. When these headers were released,
Windows NT 5.0 beta 1 and Windows 98 beta 2.1 were the current versions.
For this release when WINVER is defined as 0x0500 or greater, you can only
build beta or test applications.