您的位置:首页 > 其它

'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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c
相关文章推荐