ISupportErrorInfo Issue 
Author Message
 ISupportErrorInfo Issue

I have an object (no IDispath or Dual) support ISupportErrorInfo with
InterfaceSupportsErrorInfo implemented, so I can get error message from
Error in VB. However even if I take off ISupportErrorInfo and
InterfaceSupportsErrorInfo , I can still get the Error information which I
thought not avaible any more.
Any comments? Thanks.

Jim



Sat, 14 Feb 2004 04:13:38 GMT  
 ISupportErrorInfo Issue
The error message is generated from VB, you only remove the description
supplied by the component. BTW if you supply the information via Error,
it is still passed to the client, taking space in the marshaling packet. It
is up to the client to consult ISupportErrorInfo and take heed or not.
VB does AFAIK...

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================


Quote:
> I have an object (no IDispath or Dual) support ISupportErrorInfo with
> InterfaceSupportsErrorInfo implemented, so I can get error message from
> Error in VB. However even if I take off ISupportErrorInfo and
> InterfaceSupportsErrorInfo , I can still get the Error information which I
> thought not avaible any more.
> Any comments? Thanks.

> Jim



Sat, 14 Feb 2004 05:29:30 GMT  
 ISupportErrorInfo Issue
The purpose of ISupportErrorInfo is to make sure it is set by your object,
and not some bogus value from previous calls. You see, once set by
SetErrorInfo, the error information persists until replaced by another
error. Suppose you call a method on an object that supports error info, and
the method returns failed HRESULT. You retrieve error info and all is good.
Now you call an object that doesn't support error info, and it returns
failed HRESULT. If you now check error info, you'll get one from the
previous call. So, before relying on it, you should check whether the object
you just called supports error info - then you know that the info you've
just retrieved originates from it. That's where ISupportErrorInfo comes into
play. I believe VB does check this interface.

The other side of this issue is that if an object promises (through
ISupportErrorInfo) that its interface supports error info, it should set it
whenever it returns failed HRESULT from any method of that interface.
Otherwise the client may associate bogus error info with this failure.
--
With best wishes,
    Igor Tandetnik


Quote:
> I have an object (no IDispath or Dual) support ISupportErrorInfo with
> InterfaceSupportsErrorInfo implemented, so I can get error message from
> Error in VB. However even if I take off ISupportErrorInfo and
> InterfaceSupportsErrorInfo , I can still get the Error information which I
> thought not avaible any more.
> Any comments? Thanks.

> Jim



Sat, 14 Feb 2004 05:25:30 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ISupportErrorInfo question

2. ISupportErrorInfo Example

3. ISupportErrorInfo problems

4. ISupportErrorInfo - thread resurrection

5. How to work with ISupportErrorInfo ?

6. ISupportErrorInfo and VB

7. ISupportErrorInfo (manually)

8. help ISupportErrorInfo used on DLL runnig on server

9. ISupportErrorInfo with MTS

10. ISupportErrorInfo with MTS

11. implementing IErrorInfo and ISupportErrorInfo interfaces

12. ISupportErrorInfo question.

 

 
Powered by phpBB® Forum Software