Search code examples
c++visual-studio-2008vs-classview

Visual Studio 2008 class view missing classes


I've just ported a large project from an older version of Visual C++ to VS2008 and notice that the class view is mising a bunch of my classes. Looking at the solution view, the header files declaring those classes are present, so I'd expect to see them in class view. Any reason why certain classes would be excluded, or is there any way to refresh class view to include all the classes in the solution ?


Solution

  • Tried Hans' suggestion of looking what was different about a header file with a missing class, and noticed the following

    myheader.h

    #ifndef MYHEADER_INCLUDED
    #define MYHEADER_INCLUDED
    
    class MyClass 
    { 
    '
    '
    };
    
    #endif
    

    Now everything after the #ifdef was greyed out in the editor, which suggested the IDE throught the macro was already defined. The source also contains a fair amount of conditional inclusion in the header files, e.g.

    #ifndef MYHEADER_INCLUDED
    #include "myheader.h"
    #endif
    

    Changing the header to

    myheader.h

    #pragma once
    
    class MyClass 
    { 
    '
    '
    };
    

    seems to resolve the class view problem, though I don't know how it will effect compilation times.

    Edit Just finished and did a rebuild, no significant change to compilation time.