Loosing Error 
Author Message
 Loosing Error

Hello everyone,

I guess this question appears time-to-time, but missed it:
Why do I loose meaningful error info if following macro (placed in the
catch-block) used to "throw-or-forward" exception?

#define IssueATLError( _e ) \
  { \
  ATLTRACE( "\nThread: %p, File: %s, line: %d\n", GetCurrentThreadId(),
__FILE__, __LINE__ ); \
  CComBSTREx bstrErrText; \
  bstrErrText.Format( IDS_ERROR, \
   (LPCOLESTR)_e.ErrorMessage(), \
   (LPCOLESTR)_e.Description(), \
   (LPCOLESTR)_e.Source()); \
  ATLTRACE( bstrErrText ); \
  return Error( bstrErrText, _e.GUID(), _e.Error() ); \

like that:

 ISomeObjectPtr spSomeObject( __uuidof(SomeObject));
 spSomeObject->CallSomethingThrowingException(); // throws exception using
above mentioned macro (supposenly returning something informative, like "no
current record")


catch(_com_error& e)
    AtlIssueError( e ); // try to "forward" exception further


will not produce meaningful error. only correct HR will be returned with
description and source totaly lost - "Description: (null), Source: (null)"

I guess, some interface at the moment when final client gets chance to
process the exception already released or something?

Thanks in advance,

Tue, 06 May 2003 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Loosing Error

2. modal property sheet looses modal behavior after error message

3. Loosing pages in MultiPage Tiif after Image.RotateFlip?

4. Copying files in vc.net project looses build step

5. Webform Controls loosing Information

6. components loose the data on rebuild...

7. Loosing custom principal during requests

8. Bit shifting looses end bit(s).

9. loosing an Object in a real big chaotic typedef structure

10. loosing 0A in fputc

11. Urgent : Help on solving the problem of maintaining a 20 digit real number without loosing precision

12. Odbc driver on Windows95 client loosing connection over a NT 3.51 network


Powered by phpBB® Forum Software