Re: GetErrorInfo not working. Help !!!
- From: "Alexander Nickolov" <agnickolov@xxxxxxxx>
- Date: Tue, 17 Oct 2006 09:48:37 -0700
You must return an error HRESULT in order for the rich
exception ionformation to be considered valid. Additionally,
your object must implement ISupportErrorInfo and mark
the interface you are calling as supporting rich exception
information. Your client code must check all these conditions,
otherwise you may be picking random leftover errors.
In your server it makes no sense whatsoever to use the default
arguments of CComCoClass::Error - e.g. IID_NULL and S_OK.
You need to pass the IID of your interface and the error HRESULT
you want returned to the client.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"diablo" <diablo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:05C64EA8-A9AE-4BA6-88AB-11887BCEB009@xxxxxxxxxxxxxxxx
I am using the following code to get error information from a COM
component.
I have created the component through ATL and have supported the IErrorInfo
interface. I am manually causing an error in my COM component like this:
Error("Some error message") ;
On the client side, I am writing this code after calling
InterfaceSupportsErrorInfo():
IErrorInfo * pErrorInfo ;
hr = GetErrorInfo(NULL, &pErrorInfo) ;
Here hr returns S_OK, but pErrorInfo contains NULL. What to do?
If I am calling the function in a try block then _com_error shows me the
error message. Why is this happening?
Thanks
.
- Follow-Ups:
- Re: GetErrorInfo not working. Help !!!
- From: diablo
- Re: GetErrorInfo not working. Help !!!
- Prev by Date: Re: Connection points ?
- Next by Date: Re: Connection points ?
- Previous by thread: Re: GetErrorInfo not working. Help !!!
- Next by thread: Re: GetErrorInfo not working. Help !!!
- Index(es):
Relevant Pages
|