'HDEVNOTIFY' : missing storage-class or type specifiers
2011-08-23 10:09
651 查看
由于要响应设备的插拔,所有要注册设备的事件通知,用到'HDEVNOTIFY' 等的时侯,编译出现了莫名奇妙的错误:
error C2146: syntax error : missing ';' before identifier 'm_hDevNotify'
error C2501: 'HDEVNOTIFY' : missing storage-class or type specifiers
error C2065: 'UnregisterDeviceNotification' : undeclared identifier
error C2065: 'DEV_BROADCAST_DEVICEINTERFACE' : undeclared identifier
error C2065: 'DEVICE_NOTIFY_WINDOW_HANDLE' : undeclared identifier
后在MSDN上找到答案,只要在stdafx.h的开始定义WINVER大于0x0500即可:
例如: #define WINVER 0x0501
error C2146: syntax error : missing ';' before identifier 'm_hDevNotify'
error C2501: 'HDEVNOTIFY' : missing storage-class or type specifiers
error C2065: 'UnregisterDeviceNotification' : undeclared identifier
error C2065: 'DEV_BROADCAST_DEVICEINTERFACE' : undeclared identifier
error C2065: 'DEVICE_NOTIFY_WINDOW_HANDLE' : undeclared identifier
后在MSDN上找到答案,只要在stdafx.h的开始定义WINVER大于0x0500即可:
例如: #define WINVER 0x0501
相关文章推荐
- error C2501: 'AUX_RGBImageRec' : missing storage-class or type specifiers
- missing storage-class or type specifiers的原因及解决办法
- 关于dsound.h的问题error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
- error C2501: 'string' : missing storage-class or type specifiers
- error C2501: 'GetDocument' : missing storage-class or type specifiers 问题的处理
- 'IplImage' : missing storage-class or type specifiers
- 'IplImage' : missing storage-class or type specifiers
- 'HDEVNOTIFY' : missing storage-class or type specifiers
- [VC++]missing storage-class or type specifiers
- '_ConnectionPtr' : missing storage-class or type specifiers
- 有关error C2501: 'WINGDIAPI' : missing storage-class or type specifiers的错误
- Vc error C2629: unexpected 'class***或error C2501: missing storage-class or type specifiers
- missing storage-class or type specifiers的解决方法
- error C2501: '_Application' : missing storage-class or type specifiers
- unexpected 'class***或error C2501: missing storage-class or type specifiers 错误解决办法
- '_ConnectionPtr' : missing storage-class or type specifiers
- 做MFC的时候引用了头文件但VC还是报missing storage-class or type specifiers
- 头文件交叉定义出现--GetDocument missing storage-class or type specifiers错误的解决方法
- mfc error C2501: 'GetDocument' : missing storage-class or type spec
- GetDocument missing storage-class or type specifiers的解决方法