Can I use Activator.CreateInstance when declaring a new Geoprocessor object??

Discussion created by jvickrey79 on Jun 16, 2010
Latest reply on Oct 31, 2018 by ramgarden
I've used the below lines of code to start creating a new geodatabase but I need to do something similar for declaring a new Geoprocessor object.  I keep getting an error in my C# code right at Geoprocessor gp = new Geoprocessor.  I'm guessing this is because of the new keyword so I'm hoping I can use something similar to below code

Type t = Type.GetTypeFromProgID("esriDataSourcesGDB.AccessWorkspaceFactory.1");//("{DD48C96A-D92A-11D1-AA81-00C04FA33A15}");
                    System.Object obj = Activator.CreateInstance(t);