下面语句为什么在BCB中正常在VC6.0中却编译出错
下面语句为什么在VC6.0中编译出错在BCB中却正常
*((DWORD*)pFirstThunk)=(DWORD)GetProcAddress(hMod,(const char*)(pOriginalFirstThunk->u1.Function&0x0000FFFF));
在VC6.0中报错为
--------------------Configuration: Study - Win32 Release--------------------
Compiling...
Study.cpp
F:\Study\Study.cpp(50) : error C2296: '&' : illegal, left operand has type 'unsigned long *'
F:\Study\Study.cpp(183) : warning C4244: 'argument' : conversion from 'unsigned long' to 'unsigned char', possible loss of data
执行 cl.exe 时出错.
Study.dll - 1 error(s), 0 warning(s)
[解决办法]
强制转换一下:
*((DWORD*)pFirstThunk)=(DWORD)GetProcAddress(hMod,(const char*)((int)pOriginalFirstThunk->u1.Function&0x0000FFFF));
[解决办法]
这应该是 VC6 的bug。