我可以更改要在运行时加载的dll的名称吗? [英] Can I change the name of a dll to load at runtime?
问题描述
说我有一个名为middle.dll的dll,它从runme.dll导入函数
Say I have a dll named middle.dll that is importing functions from runme.dll
我现在有一个替换的runmeDBG.dll,它具有与runme.dll导出的所有相同功能
I now have a replacement runmeDBG.dll that has all the same functions exported as runme.dll
是否可以使用middle.dll,但可以将其链接到从runmeDBG.dll而不是runme.dll导出的功能上?
Is there a way to use middle.dll but have it link to the functions exported from runmeDBG.dll instead of runme.dll?
我可以更改middle.dll的代码,但不知道将包含在构建Middle.dll时要使用的功能的dll名称.
I can change the code for middle.dll but do not know the name of the dll that will contain the functions to use when I build middle.dll.
(所有这些都是在C/C ++和Mingw工具集的上下文中完成的)
(And all of this in the context of C/C++ and the Mingw toolset)
推荐答案
我假设Middle.dll不是您的,并且它静态链接到runme.dll.不,在静态链接的情况下,无法更改dll名称;但是,您可以将runmeDBG.dll重命名为runme.dll,并将其放置在dll加载程序可以找到它的位置.或使用清单将可执行文件直接指向特定路径.并非必须将runme.dll放在特定路径中,对吗?
I'm assuming middle.dll is not yours, and it links statically to runme.dll. No, there's no way to change dll name in case of static linkage; you can, however, rename the runmeDBG.dll to runme.dll and place it somewhere where dll loader will find it. Or use a manifest to point the executable straight to the specific path. It's not a requirement that runme.dll sits in at specific path, is it?
这篇关于我可以更改要在运行时加载的dll的名称吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!