如何为我的应用程序的DLL创建一个单独的文件夹? [英] How can I make a separate folder for my application's DLLs?

查看:117
本文介绍了如何为我的应用程序的DLL创建一个单独的文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功地将一个大型MFC项目分成了两个更小的DLL项目。现在我想在我的应用程序的文件夹中有一个名为DLL的单独文件夹,其中放置所有来自子项目的所有DLL。

I have successfully divided a large MFC project into a couple of smaller DLL projects. Now I want to have a separate folder called "DLL" in my application's folder, where all the all the DLLs from the subprojects are placed.

任何人都可以指导我如何实现这一目标。

Can anybody give me guidance in how to achieve this?

推荐答案

如果你使用LoadLibrary,你只需要明确指定加载的DLL的完整路径。

If you use LoadLibrary, you simply have to explicitly specify the full path of the DLLs you load.

如果DLL是隐式链接的,你可以通过两种方式

If the DLLs are implicitly linked, you can do this in two ways.


  • 让安装程序修改PATH变量。

  • 编写一个加载器应用程序,在本地修改路径变量,然后执行真正的可执行文件。

最好的解决方案是将DLL放在与可执行文件相同的目录中。

The best solution would be to simply put the DLLs in the same directory as the executable.

这篇关于如何为我的应用程序的DLL创建一个单独的文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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