百分百源码网-让建站变得如此简单! 登录 注册 签到领金币!

主页 | 如何升级VIP | TAG标签

当前位置: 网站模板(百分百源码网)>电脑软件>服务器> 在XP系统上涌现没法定位程序输入点 K32GetProcessMemoryInfo的解
分享本文到:

在XP系统上涌现没法定位程序输入点 K32GetProcessMemoryInfo的解

发布时间:05/16 来源:未知 浏览: 关键词:

VC2012晋级补丁5.0之后,编译出来的程序发明在XP系统没法定位程序输入点 K32GetProcessMemoryInfo于动态链接库kernel32.dll之上。

以前程序不断在XP上安装正常,今天测试组的同事忽然发明,新发表的版本不能在XP上运用,这个题目比较奇怪,由于以往的版本都是没有题目的。为何会忽然涌现这个题目呢?一开端就去查找是否所有工程都运用V110_XP来编译,找完所有工程都没出错。最后才想到近来晋级VC2012的Update5.0的补丁,再打包编译之后,才发明XP的电脑不能运用了。

经过查找剖析,发明是如下题目:

这是因为GetProcessMemoryInfo在不一样系统版本号不一样导致的,官方注明如下:

Remarks
Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI version number affects the name used to call the function and the library that a program must load.
If PSAPI_VERSION is 2 or greater, this function is defined as K32GetProcessMemoryInfo in Psapi.h and exported in Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as GetProcessMemoryInfo in Psapi.h and exported in Psapi.lib and Psapi.dll as a wrapper that calls K32GetProcessMemoryInfo.
Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as GetProcessMemoryInfo. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the program with -DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.

解决方案如下:

只需要在#include <psapi.h>援用前增加

复制代码 代码如下:

#ifndef PSAPI_VERSION
#define PSAPI_VERSION 1
#endif
#include <psapi.h>
#pragma  comment(lib,"Psapi.lib")

看来微软已经不支撑XP系统了,因而所有发表的新版本软件已经不再测试XP的兼容性了。看来明年,也需要转向不支撑XP系统了,否则需要投入的测试老本和保护老本急剧上升中,需要全面转向WIN7和WIN10系统的支撑。有此可见,生态系统就是这么重要的事情,可以左右大局。

热门标签:dede模板 / destoon模板 / dedecms模版 / 织梦模板
责任编辑:WBkhx
打赏

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

百分百源码网 建议打赏1~10元,土豪随意,感谢您的阅读!

共有152人阅读,期待你的评论!发表评论
昵称: 网址: 验证码: 点击我更换图片
最新评论

本文标签

广告赞助



订阅获得更多模板

本文标签

广告赞助

订阅获得更多模板