ISupportErrorInfo and VB 
Author Message
 ISupportErrorInfo and VB

Greetings,

I have an ATL COM that supports ISupportErrorInfo.  At one point (for
testing purposes) I issue:

return Error ("This is a test error", IID_IErrorTester, E_FAIL);

The VB Component receives this and interprets it correctly as an error (via
on error goto...).  The problem is that VB is not successfully retrieving
from IErrorInfo...  it is getting the correct HRESULT as err.number
(E_FAIL), but the Err.Description is always "Object Variable or With Block
Variable not set" (regardless of whether I use E_FAIL, E_POINTER, or
whatever else), and always says err.source is the VB COM (not my C++ ATL
COM).

I assume we are doing something wrong in the VB Code, but I can't deduce
what.  Perhaps it is in the C code...  any ideas?

Thanks everyone,
-Dale



Sun, 04 Apr 2004 04:39:13 GMT  
 ISupportErrorInfo and VB
Does you object implement ISupportErroInfo? Is your interface correctly
recognized by the implementation of InterfaceSupportsErrorInfo?

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

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


Quote:
> Greetings,

> I have an ATL COM that supports ISupportErrorInfo.  At one point (for
> testing purposes) I issue:

> return Error ("This is a test error", IID_IErrorTester, E_FAIL);

> The VB Component receives this and interprets it correctly as an error
(via
> on error goto...).  The problem is that VB is not successfully retrieving
> from IErrorInfo...  it is getting the correct HRESULT as err.number
> (E_FAIL), but the Err.Description is always "Object Variable or With Block
> Variable not set" (regardless of whether I use E_FAIL, E_POINTER, or
> whatever else), and always says err.source is the VB COM (not my C++ ATL
> COM).

> I assume we are doing something wrong in the VB Code, but I can't deduce
> what.  Perhaps it is in the C code...  any ideas?

> Thanks everyone,
> -Dale



Sun, 04 Apr 2004 06:46:04 GMT  
 ISupportErrorInfo and VB
Yes, and yes.... however...

After a few hours of trial and error on my part I found out that the VB
Programmer had (unknowingly) made an error.  The on error statements within
his code were referring the error back to a main cls module.  This had the
result of the main module thinking the error came from the other (VB) module
instead of from my component (called from that secondary module).
Therefore, the error code was getting passed through but the location was
skewed by the sort of error-passing he had implemented.

Hmm..  hope that made sense :).  Anyways, food for thought if someone else
has a similar problem.

-Dale


Quote:
> Does you object implement ISupportErroInfo? Is your interface correctly
> recognized by the implementation of InterfaceSupportsErrorInfo?

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

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



> > Greetings,

> > I have an ATL COM that supports ISupportErrorInfo.  At one point (for
> > testing purposes) I issue:

> > return Error ("This is a test error", IID_IErrorTester, E_FAIL);

> > The VB Component receives this and interprets it correctly as an error
> (via
> > on error goto...).  The problem is that VB is not successfully
retrieving
> > from IErrorInfo...  it is getting the correct HRESULT as err.number
> > (E_FAIL), but the Err.Description is always "Object Variable or With
Block
> > Variable not set" (regardless of whether I use E_FAIL, E_POINTER, or
> > whatever else), and always says err.source is the VB COM (not my C++ ATL
> > COM).

> > I assume we are doing something wrong in the VB Code, but I can't deduce
> > what.  Perhaps it is in the C code...  any ideas?

> > Thanks everyone,
> > -Dale



Sun, 04 Apr 2004 12:35:58 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 (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