WINVER>=0X500

本文解决了在使用Windows API时遇到的多个错误,如'SM_MOUSEWHEELPRESENT'等未声明标识符的问题。这些错误通常出现在Win2000及更高版本中引入的API或常量上。通过在预处理命令中定义WINVER为0x0500,可以确保代码兼容Win2000及以上版本。
error C2065: 'SM_MOUSEWHEELPRESENT' : undeclared identifier
error C2065: 'SM_XVIRTUALSCREEN' : undeclared identifier
error C2065: 'SM_YVIRTUALSCREEN' : undeclared identifier
error C2065: 'SM_CXVIRTUALSCREEN' : undeclared identifier
error C2065: 'SM_CYVIRTUALSCREEN' : undeclared identifier
error C2065: 'SM_CMONITORS' : undeclared identifier
error C2065: 'SM_SAMEDISPLAYFORMAT' : undeclared identifier

WINVER>=0X500指Win2000以上。有些API或常数只有在Win2000以上才支持。

故在预处理命令处加一句

#define WINVER 0x0500

 

C:\Users\Lenono3>drmemory -- E:\Code\testMicroCalc\testZoomCalc\x64\Debug\testZoomCalc.exe <Application E:\Code\testMicroCalc\testZoomCalc\x64\Debug\testZoomCalc.exe (31456). Dr. Memory internal crash at PC 0x00007ff77a72f152. Please report this at http://drmemory.org/issues along with the results of running '-debug -dr_debug'. Program aborted. 0xc0000005 0x00000000 0x00007ff77a72f152 0x00007ff77a72f152 0x0000000000000001 0x0000000000000000 Base: 0x0000000071000000 Registers: eax=0x0000000000000000 ebx=0x0000000000000000 ecx=0x00000179ea9a4400 edx=0x00007ff909430057 esi=0x0000000000000000 edi=0x0000000000000000 esp=0x00000179ea9c17e0 ebp=0x0000000000000000 r8 =0x00000179ea9c58b0 r9 =0x0000000000000000 r10=0x00000179ea9a4a58 r11=0x00007ff77a716c13 r12=0x00000179ea9c58b0 r13=0x00000179ea9a4400 r14=0x00000179ea9c1960 r15=0x00000179ea9c58b0 eflags=0x0000000000010246 2.6.20133-0-(Feb 15 2025 02:53:31) WinVer=105;Rel=2009;Build=26100;Edition=CoreCountrySpecific -no_dynamic_options -logdir 'E:\LenovoSoftstore\Install\Dr. Memory\drmemory\logs\dynamorio' -client_lib 'E:\LenovoSoftstore\Install\Dr. Memory\bin64\release\drmemorylib.dll;0;-logdir `E:\LenovoSoftstore\Install\Dr. Memory\drmemory\logs` -symcache_dir `E:\LenovoSoftstore\Install\Dr. Memory\drmemory\logs\symcache` -lib_blo E:\LenovoSoftstore\Install\Dr. Memory\dynamorio\lib64\release\dynamorio.dll=0x0000000071000000 C:\WINDOWS/system32/RPCRT4.dll=0x00000179805f0000 E:\LenovoSoftstore\Install\Dr. Memory\bin64\release\drmemorylib.dll=0x00007ff77a6b0000 E:\LenovoSoftstore\Install\Dr. Memory\bin64\release/dbghelp.dll=0x00007ff77a970000 C:\WINDOWS/system32/ucrtbase.dll=0x0000017980000000 C:\WINDOWS/system32/kernel32.dll=0x0000017980150000 C:\WINDOWS/system32/KERNELBASE>
03-08
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值