Search code examples
c#cominterfaceguidconnection-points

How to get guid from unknown com object interface (e.g. connection point)?


I've got running service which is available via COM. I can connect with it by using Activator.

I connect COM library

using MyLib;

and then get my object by Instance

Activator.CreateInstance((Type.GetTypeFromProgID("RunningInstance")));

this is actually IConnectionPointContainer

there are several connection points and to get one there is

FindConnectionPoint(SomeGuidHere, out MyConnectionPoint);

if I remember correctly in cpp atl there is just __uuid(IHelloWorld)

the problem is: how to get guide of some "IHelloWorld" interface (connection point) in the Container ?


Solution

  • Use EnumConnectionPoints() as described in this answer.