Computer Chess Club Archives


Search

Terms

Messages

Subject: How does one get rid of a non-C++ exception?

Author: KarinsDad

Date: 10:02:15 06/01/00


In my code, I have something similar to the following:

while (bIsRunning)
{
  try
  {
    Function1();
  }
  catch(CException* e)
  {
    ReportError(e);
    e->Delete();
  }
  catch(...)
  {
    ReportError();
  }
}

Function1 calls some Win32 API calls and I think that one of them throws a
non-C++ exception (i.e. it does not get caught in the catch(CException* e) code
above). Since this is in a loop, the exception does not get deleted (like a C++
exception would get deleted in the code above), so once Function1 throws a
non-C++ exception, this code (catch(...)) reports it, loops back, immediately
finds an exception within the Try block, and reports the exception again
(effectively infinitely looping).

However, this appears to only happen with certain exceptions, but not all
exceptions (for example, if I just try to replace Function1 with a throw myself,
I cannot reproduce this behavior).

Does anyone have an idea on how to get rid of an exception caught within the
catch(...)?

Thanks,

KarinsDad :)



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.