Search code examples
c#cominstance

How to create multiple COM Instances via C#


i try to Start two instances of Application like this:

var t = Type.GetTypeFromProgID("Application",null);
var app1 = Activator.GetInstance(t);
var app2 = Activator.GetInstance(t);

It launches the first application and the second is a copy of the first, not the new instance.

How to run two different app?


Solution

  • try

    var t = Type.GetTypeFromProgID("Application",null);
    
    var app1 = Activator.GetInstance(t);
    
    var t1 = Type.GetTypeFromProgID("Application",null);
    
    var app2 = Activator.GetInstance(t1);