多次加载相同的dll [英] Load the same dll multiple times
问题描述
我想加载相同的dll例如Lib.dll多次!
I want to load the same dll e.g. Lib.dll multiple times!
- >需要为每个LoadLibrary创建一个新进程(CreateProcess函数)!
-> need creating a new process (CreateProcess function) for every LoadLibrary!
一些提示?!
Thx并打招呼
推荐答案
您希望DLL的每个实例具有单独的数据段。这是我可以想到的问题的唯一原因。
It sounds like you want each instance of the DLL to have separate data segments. That's the only reason I can think of for the question.
实现这一点的唯一方法是确保每次你调用 LoadLibrary
,该DLL有不同的文件名。将DLL复制到临时文件,每次需要加载它,确保您使用的名称不同于任何加载的DLL实例。
The only way to achieve this is to make sure that each time you call LoadLibrary
, the DLL has a different filename. Copy the DLL to a temporary file each time you need to load it, making sure that the name you use is different from any loaded instance of the DLL.
我回声以上的建议,鼓励您重新设计系统架构。
I echo the comments above that encourage you to re-design the system architecture.
这篇关于多次加载相同的dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!