* Bernd Strieder:
> Hello,
>
> reuce-google@yahoo.de wrote:
>
>> try
>> {
>> CException * pEc = m_pEc;
>> m_pEc = NULL; // Clear variable.
>> throw pEc;
>> }
>> catch (CMemoryException * pEc)
>> {
>> // Won't catch the exception.
>> }
>> catch (CException * pEc)
>> {
>> // Will catch the exception.
>> }
>>
>> ....
>>
>> How can I rethrow the exception, so that it will be thrown with the
>> right type information (CMemoryException) - even if I don't know the
>> type beforehand?
>
> Add a virtual rethrow method to the base class, which is overwritten in
> all derived classes to throw itself, i.e. with the right type. Then
> call that method.
The OP seems to be using MFC (Microsoft Foundation Classes) exceptions;
if so, then no control.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?