windows系统--软件兼容:DLL库 或 OCX插件 在XP SP2 系统、XP SP3 系统的使用

背景描述:

客户的ocx插件在win7 win10上都没有问题, 但在XP SP3 和 XP SP2 遇到了问题。自己没有解决掉,领导出手解决, 把解决问题的方法和步骤学习分享一下。

解决问题的思路

1 使用Depends软件分析插件依赖的库 和 依赖的函数
2 安装依赖库, 处理依赖的函数

解决问题方法

一 配置项目

1 右击项目 选择properties -> 选择 general
配置 Platform Toolset 为 Visual Studio 2013-Windows XP(v120_xp)
配置 Use of MFC 为 Use MFC in a Static Library
2 右击项目 选择properties -> 选择 c/c++ -> 选择Code Generation
配置 Runtime Library 为 /MT

二 安装运行库

由于我们软件是用vs2013 编译的所以只需要安装vs2013 运行库 和 vs2010运行库
XP SP3 系统直接安装运行库
XP SP2 系统
(1) 先安装WindowsXP-KB942288-v3-x86.exe
(2) 安装 vs2013 运行库 和 vs2010运行库

三 安装依赖库

根据depends 安装所有的依赖库

四 分析解决依赖函数 【XP3 自己未发现有此问题】

报下图的错误GetLogicalProcessorInformation找不到:
在这里插入图片描述
原因:XP SP2 不支持 std::mutex和std::thread问题
解决方法: 替换掉std::mutex和std::thread

衍生:

备注: 衍生部分均复制别人文档, 原文链接如下:https://blog.csdn.net/nature19862001/article/details/69952434
微软的2015 c++for xp的介绍:
https://msdn.microsoft.com/en-us/library/jj851139.aspx
C++ runtime support
Along with the Windows XP platform toolset, the C Runtime Library (CRT), Standard Template Library (STL), Active Template Library (ATL), Concurrency Runtime Library (ConCRT), Parallel Patterns Library (PPL), Microsoft Foundation Class Library (MFC), and C++
AMP (C++ Accelerated Massive Programming) library include runtime support for Windows XP and Windows Server 2003. For these operating systems, the minimum supported versions are Windows XP Service Pack 3 (SP3) for x86, Windows XP Service Pack 2 (SP2) for x64,
and Windows Server 2003 Service Pack 2 (SP2) for both x86 and x64.

估计std::mutex和std::thread最低需要Windows XP Service Pack 2 (SP2) for x64。没找到x64的虚拟机。。

猜你喜欢

转载自blog.csdn.net/XHW___001/article/details/85054986