Win32 SDK 程序!ReadProcessMemory ( hProcess ,(LPVOID)0x00449B40 ,(LPVOID)&dwBase ,sizeof(dwBase) ,NULL );程序可以成功编译,但是给出不少警告!!winmain.cpp
.\winmain.cpp(273) : warning C4312: “类型转换”: 从“DWORD”转换到更大的“LPVOID以前在 VC6 下是没有问题的,我在程序中 sizeof(LPVOID)结果返回 4 ,长度和 DWORD 一样啊,为什么强制转换时会给出 LPVOID 更大的警告!下面这个问题最重要,我怎么做能消掉这个警告!!!
.\winmain.cpp(273) : warning C4312: “类型转换”: 从“DWORD”转换到更大的“LPVOID以前在 VC6 下是没有问题的,我在程序中 sizeof(LPVOID)结果返回 4 ,长度和 DWORD 一样啊,为什么强制转换时会给出 LPVOID 更大的警告!下面这个问题最重要,我怎么做能消掉这个警告!!!
解决方案 »
- innosetup注册msado15.dll卸载后重装无法连接数据库
- MFC列表控件删除列
- 请教一个高难度问题,我主动POST一个HTTP连接过去,服务端返回的是XML格式,不是HTML,怎样通过VC++获取XML文件内容啊??急急!
- 调用函数返回发生错误,这是怎么回事?
- 一个链表串起数个数组,结果链表最后没有数据(给分100)兄弟们SAVE ME!
- 标准控制GDI资源泄漏????
- 关于this指针的问题,请各位多多指教,小弟感激不尽!!!
- Debug与Release的困惑,求救!
- ocx文件(OLE) 如何查找函数地址(已知函数接口)
- 如何学好VC
- 基础问题
- VC控制Zebra打印机打印汉字方法
ReadProcessMemory ( hProcess ,reinterpret_cast<LPVOID>(0x00449B40) ,(LPVOID)&dwBase ,sizeof(dwBase) ,NULL );
警告是:
.\winmain.cpp(278) : warning C4312: “reinterpret_cast”: 从“DWORD”转换到更大的“LPVOID”
'operation' : conversion from 'type1' to 'type2' of greater size
This warning detects 64-bit portability issues. You attempted to assign a 32-bit value to a 64-bit type. For example, casting a 32-bit int or 32-bit long to a 64-bit pointer.This can be an unsafe conversion in some circumstances when sign extension occurs. If a negative number is assigned to a pointer type of a size greater than the int, sign extension will occur and the pointer value will refer to a memory address different from the value of the int.This warning is only issued when /Wp64 is used. See /Wp64 for more information. Also, see Rules for Using Pointers.The following code sample generates C4312: