John
John

Reputation: 961

Is it possible to create a COM object programatically . NET?

Long story short, trying to build a 'Smoke Tester' application. I'd like to be able to dynamically be given "Hey, this COM assembly (guid, progid) should exist" and attempt to create the COM object via ProgId or guid.

I know how to [ComImport] classes, but instead I'm looking to do this programatically. Is this possible?

Upvotes: 0

Views: 410

Answers (1)

SLaks
SLaks

Reputation: 887469

Call Activator.CreateInstance(Type.GetTypeFromProgID("progid")) (or Type.GetTypeFromCLSID).

Upvotes: 4

Related Questions