简体   繁体   中英

Can I load isolated instances of an unmanaged dll in a C++/CLI wrapper

I have an unmanaged DLL (unmangaged.dll) in a C++/CLI wrapper. The unmanaged.dll is a subcomponent of a control that is instantiated in several places on the screen. I each control instances to have its own instance of the unmanaged.dll (since each unmanaged.dll maintains a different state).

Is there any way to instantiates the same unmanaged.dll so as to have to completely separate states? (eg different settings within each unmanaged.dll instance.)

Unfortunately everything I read about unmanaged.dll in C++/CLI wrappers is that all calls are static.

Thanks

There is no concept of "instance of native DLL in a process" in Windows. Only one copy of a native DLL can be loaded into a given process.

You can:

  • have multiple instances of objects created by the DLL
  • load DLL into as many processes as you need and use some sort of Inter Process Communication (IPC) to talk to it from main process.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM