
How to work with ISupportErrorInfo ?
Derive your class from ISupportErrorInfoImpl. Put
COM_INTERFACE_ENTRY(ISupportErrorInfo) into an interface map. Whenever you
need to return a failure, use one of many CComCoClass::Error overloads. In
the simplest form, you can write
return Error(OLESTR("Something real bad happened"));
--
With best wishes,
Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat, and
wrong." H.L. Mencken
Quote:
> Hi.
> I am newbie in ATL and COM.
> How i can implement IErrorInfo(IErrorSupportInfo) in my ATL class CMyClass
> so in Visual Basic I can write:
> ''''
> Sub Test()
> On Error Goto HandleError
> Dim obTest as new MyApp.MyClass
> obTest.Foo
> HandleError:
> MsgBox Err.Description
> End Sub
> ''''
> Err.Description holds a description of error.
> Thank for regards.
> Sergey.