本文介绍了可执行文件加载与已加载dll相同的dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将开始对我的项目进行重大修改,我只想澄清一些,因为我认为我的设计可能有点复杂。

I'm about to start making major modification to my project and I just want to clarify something as I think my design maybe somewhat complicated.

我有一个可执行文件加载dll,让我们调用这个dll1,然后加载dll2。
可执行文件还加载dll2。

I have an executable that loads a dll, lets call this dll1, this then loads dll2.The executable also loads dll2.

我要问的是我有两个dll2的全局和静态成员变量的实例,第二次加载dll2发生或可以执行只能加载1的dll2即使dll2由不同的dll加载

What I'm asking is do I have two instances of dll2's global and static member variables, does the second load of dll2 happen or can an execuable only ever load 1 of dll2 even if dll2 was loaded by a different dll?

我知道我应该只有一个副本的dll2的代码在内存中好的这是我感兴趣的全局和静态变量。

I know I should only have one copy of dll2's code in memory this is fine. It is the global and static variables I'm interested in.

推荐答案

你只能有一个实例加载任何特定的DLL过程。

You can only have one instance of any particular DLL loaded per process.

这篇关于可执行文件加载与已加载dll相同的dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-15 23:45