I get a COM error when trying to connect to an event on a COM object. Here is the code I'm trying to execute.
COMClass a = IComClass as ComClass;
a.SomeEvent += new SomeEvent_EventHandler(MethodNameHere);
Line 2 throws a COMException with the following information:
System.Runtime.InteropServices.COME error.
Message = "Exception from HRESULT: 0x80040202"
Source = "mscorlib"
ErrorCode = -2147220990
StackTrace: in System.Runtime.InteropServices.ComTypes.IConnectionPoint.Advise (pUnkSink, Int32 & pdwCookie object)
Does anyone have any ideas why I cannot connect to a COM event or if there is a workaround for COM events?
Chris
widmayer
source share