FIX: ClassView Doesn't Show Derived Classes in Embedded Namespace (205402)



The information in this article applies to:

  • Microsoft Visual C++, 32-bit Enterprise Edition 5.0
  • Microsoft Visual C++, 32-bit Professional Edition 5.0

This article was previously published under Q205402

SYMPTOMS

The ClassView pane doesn't display a class that is in an embedded namespace if it inherits from another class that is defined in the outer namespace.

RESOLUTION

Use a typedef statement to create an alias for the class name in the outer namespace, and then derive from it.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.  This bug was corrected in Microsoft Visual C++ 6.0.

MORE INFORMATION

Steps to Reproduce Behavior

Add the following code to a C++ source or header file:
namespace A
{
   class ClassA
   {
   public:
      ClassA() {}
   };

   // Create an alias for the outer class.
   typedef A::ClassA A_ClassA;

   namespace B
   {
      // This class is not displayed in ClassView.
      class ClassB1 : public A::ClassA
      {
      public:
         ClassB1() {}
      };

      // This class is displayed in ClassView.
      class ClassB2 : public A_ClassA
      {
      public:
         ClassB2() {}
      };
   } // namespace B
} // namespace A
				

Modification Type:MajorLast Reviewed:10/24/2003
Keywords:kbBug kbClassView kbfix kbide kbVC600fix KB205402