Re: GetErrorInfo not working. Help !!!

Tech-Archive recommends: Fix windows errors by optimizing your registry



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


.



Relevant Pages

  • Re: Micro Controller Advice/Help Needed
    ... provide some sort of serial port pinout on the side of the board? ... connector for the phone line and an RS232 connector for the controller. ... interface with the XE2422H. ... Rich Webb Norfolk, VA ...
    (comp.arch.embedded)
  • Re: TK for web application
    ... tool,My interface such as menu would have more third dimension,even some ... containing a link.Can you tell me what can make me accomplish this rich ... and at xul: ... I have a fondness for OpenLaszlo, ...
    (comp.lang.ruby)
  • Re: ITextFont and c#
    ... tom or Text Object Model is COM interface for Richtext edit box. ... the interface be sending a message to the Rich text box. ... I could also get teh instance of ITextRange and other interface from teh ... I have included the tom COM component through the addreference. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Second Copy of Delphi 2005
    ... Or whining that you don't like the tool-set or rich new interface, ...
    (borland.public.delphi.non-technical)