The information in this article applies to:
SYMPTOMSAttempting to obtain run-time class information for CInternetException by using the RUNTIME_CLASS macro fails. The CRuntimeClass structure returned for CInternetException is empty. RESOLUTIONC++ exception handling can determine the type of exception thrown. A typical handler has a format similar to the following:
If for some reason it is still necessary to obtain the run-time class
information for a class that may be CinternetException, it is possible to
use the Run-Time Type Information (RTTI) provided by Visual C++. To use
RTTI, the Run-Time Type Information must be enabled in the C++ Language
settings for the project. Then, the dynamic_cast operator can be used to
attempt a conversion of the exception to CInternetException. If the cast
fails, the exception is of another type. It is also possible to obtain the
Run-Time Type Information directly as follows:
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual C++ version 6.0. MORE INFORMATIONThe following code demonstrates the problem:
Looking at prt in the debugger shows that the CRuntimeClass structure is
empty. This behavior is not observed in projects that are statically linked
to MFC.
Additional query words: RTTI
Keywords : kbcode kbVC500bug kbVC600fix |
Last Reviewed: July 20, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |