I have an method (handler) in C# that receives an event raised from a C++ COM component; the parameter is an object (the object is an interface IErrorInfo frmo C++)
I need to access the IErrorInfo object for the message ... but cannot cast it correctly ... I keep getting invalid cast exceptions .. Ihave tried:
_Exception iEx = (_Exception)pErrorInfo;
System.IntPtr pEx = System.Runtime.InteropServices.Marshal.GetComInterfaceForObject(pErrorInfo, typeof(_Exception));}
both result in invalid cast exceptions?
I do not know what to cast the object to for access to the underlying IErrorInfo ?
View Complete Post