重定向插件 DLL 清单中的依赖 DLL
我正在编写一个 DLL,它可能通过调用 LoadLibrary 来加载,并指定其安装位置的绝对路径。 (对 LoadLibrary 的调用很可能在第三方应用程序中,客户必须将应用程序配置为指向我的 DLL。)
问题是我的 DLL 依赖于安装在与我的同一目录中的其他 DLL -但该目录不在 DLL 搜索路径上。
我想我需要将一个清单与我的主 DLL 关联起来,该清单指向我的辅助 DLL ...有人有这样做的例子吗?
注意:这不是托管代码 - 仅是本机代码。
I am writing a DLL which is likely to be loaded via a call to LoadLibrary specifying an absolute path to where it has been installed. (The call to LoadLibrary may well be in a third party application, and the customer will have to configure the application to point at my DLL.)
The problem is that my DLL depends on other DLLs which are installed in the same directory as mine - but that directory is not on the DLL search path.
I think I need to associate a manifest with my primary DLL which points at my secondary DLLs ... does anyone have any examples of doing that?
Note: This is not managed code - native only.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于遇到同样问题的其他人,我最终通过将所有辅助 DLL 标记为延迟加载,然后从主 DLL 的目录加载延迟加载辅助函数来解决了这个问题。
For anyone else with the same problem, I eventually solved this by marking all the secondary DLLs as delayload, and then having the delayload helper function load from the directory of the primary DLL.