Here is one that I am having trouble with.

I need to load multiple instances of a DLL in my application and have each instance isolated from the others (the DLL has global variables).

In the past we had multiple applications running and each application loaded the DLL. Because the application was in a differn process, each application got its own copy of the global variables.

I need to merge all the old applications into one, but I can't figure out how to isolate the DLL (changing the DLL is NOT an option).

The solution can be C++, MC++, C#, .NET whatever, this part is starting from a clean page. I looked at .NET remoting, but for a singleton invocation the DLL is shared with all clients.

Anyone with any ideas?