编写加载msvcr80.dll并暴露free() - 函数的DLL [英] Writing a DLL that loads msvcr80.dll and exposes the free()-function

查看:205
本文介绍了编写加载msvcr80.dll并暴露free() - 函数的DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个依赖于MSVCR80的第三方DLL,并分配我需要清理的资源。图书馆不不公开免费功能。相反,我需要加载相同的运行库,并手动调用免费函数。

I have a third-party DLL that depends on MSVCR80 and allocates resources that I need to cleanup. The library does not expose a free-function for doing this. Instead, I need to load the same runtime library and manually call the free function.

作为一种解决方法,我正在尝试编写一个加载正确运行时的包装DLL,并公开免费功能。此DLL是使用Visual Studio 2010创建的,并且依赖于单独的运行时库。执行 LoadLibrary(msvcr80.dll)失败,出现错误R6034,我猜是因为清单问题。

As a workaround I'm trying to write a "wrapper" DLL that loads the correct runtime and exposes the free function. This DLL is created using Visual Studio 2010 and is dependent on a separate runtime library. Doing LoadLibrary("msvcr80.dll") fails with error R6034 which I guess is because of manifest issues.

甚至可以使用 LoadLibrary 加载msvcr80.dll?我需要创建一个清单,将其嵌入DLL并将msvcr80.dll存储在与我的包装器DLL相同的目录中?

Is it even possible to load msvcr80.dll using LoadLibrary? Do I need to create a manifest, embed it into the DLL and store msvcr80.dll in the same directory as my wrapper DLL?

我意识到这是一个缺陷第三方图书馆,但我几乎坚持这个版本。让供应商解决这个问题很有可能不是一个选择。

I realize that this is a flaw in the third-party library, but I'm pretty much stuck with this version. Getting the vendor to fix this is most likely not an option.

推荐答案

可能有更好的解决方案,但万事如意,您可以在某个地方找到VC ++的一个副本 2005 Express Edition(=免费,不需要盗版;)),它使用版本8.0的编译器,因此与有缺陷的dll相同的运行时。

Probably there are better solutions, but in case everything else failed you could find somewhere a copy of VC++ 2005 Express Edition (=free, no piracy is needed ;) ), which uses the version 8.0 of the compiler, and thus the same runtime of the defective dll.

然后,您将使用它构建包装器dll,这将只调用其CRT(双重)提供的免费检查你使用的是dll版本!)。

Then you would build your wrapper dll with it, which would just call the free provided by its CRT (double check that you're using the dll version!).

这篇关于编写加载msvcr80.dll并暴露free() - 函数的DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆