appdomain load one com dll for multiple time and keep memory isolated
There is a COM DLL(VC6.0 ATL wizard built), I want to use appdomain's identities to impliment one process creates multiple appdomain，every one load this COM DLL and ensure everyone COM DLL to have isolated memory space。

For example

  AppDomain Domain1 = AppDomain.CreateDomain("D1");
  AppDomain Domain2 = AppDomain.CreateDomain("D2");
    
  object obj1 = Domain1.CreateInstanceFromAndUnwrap("UnManagedCOMDLL.dll", "UnManagedCOMDLL.ShowTag");

  object obj2 = Domain2.CreateInstanceFromAndUnwrap("UnManagedCOMDLL.dll", "UnManagedCOMDLL.ShowTag")


In this dll,there is a global variable, every time it loads,it++. although the com loaded in different appdomain,the global variable is shared by each other.

why is such result happened? appdomain should keep memory iasolation, but it failed.

however, to managed dll, appdomain can work.

help me!!!!!
appdomain load one com dll for multiple time and keep memory isolated
===

There is a COM DLL(VC6.0 ATL wizard built), I want to use appdomain's identities to impliment one process creates multiple appdomain，every one load this COM DLL and ensure everyone COM DLL to have isolated memory space。

For example

  AppDomain Domain1 = AppDomain.CreateDomain("D1");
  AppDomain Domain2 = AppDomain.CreateDomain("D2");
    
  object obj1 = Domain1.CreateInstanceFromAndUnwrap("UnManagedCOMDLL.dll", "UnManagedCOMDLL.ShowTag");

  object obj2 = Domain2.CreateInstanceFromAndUnwrap("UnManagedCOMDLL.dll", "UnManagedCOMDLL.ShowTag")


In this dll,there is a global variable, every time it loads,it++. although the com loaded in different appdomain,the global variable is shared by each other.

why is such result happened? appdomain should keep memory iasolation, but it failed.

however, to managed dll, appdomain can work.

help me!!!!!