How to work with ISupportErrorInfo ? 
Author Message
 How to work with ISupportErrorInfo ?

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.



Sun, 02 May 2004 02:16:22 GMT  
 How to work with ISupportErrorInfo ?
Set the error info within your com object. You can do it by calling the
AtlSetErrorInfo and passing the HRESULT and   Error message so that it can
be accessed by the client

naveen

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.



Sun, 02 May 2004 02:40:26 GMT  
 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.



Sun, 02 May 2004 02:43:47 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ISupportErrorInfo question

2. ISupportErrorInfo Example

3. ISupportErrorInfo problems

4. ISupportErrorInfo - thread resurrection

5. ISupportErrorInfo and VB

6. ISupportErrorInfo (manually)

7. help ISupportErrorInfo used on DLL runnig on server

8. ISupportErrorInfo Issue

9. ISupportErrorInfo with MTS

10. ISupportErrorInfo with MTS

11. implementing IErrorInfo and ISupportErrorInfo interfaces

12. ISupportErrorInfo question.

 

 
Powered by phpBB® Forum Software