![]() |
Chapter 7 | ![]() |
The problem is that the damned thing never seems to work. It will attempt to update itself while you're typing and if you're
not sticking to MFC derived classes (ie, Standard C++, using the STL, using structs, or are using non-Microsoft blessed typedefs
or other Tom foolery) this will cause a problem. Sometimes it just stops working anyway, even if you're doing everything right.
I haven't seen it happen, but I assume you could walk away from your screen for 15 minutes, change nothing, come back, and it
will be broken.
'Broken' manifests itself in several ways;
The problem could simply be that it never attempts to update again, or that it drops all your classes into a global space, and stops differentiating between member in a given class, or most likely, it will just display 'Failed to load'.
This can be caused by so many different problems that it's impossible to predict which one is the culprit. Lucky for us, it has a very Microsoft like solution - simply delete the file that it's saving all the changes in, close the project tree, and re-expand it. If that doesn't work, repeat, close your project workspace, close Visual Studio, and start it back up again.
The file that stores the class meta-information is the one in the same directory as your project that has the .NCB extension. Delete it. It's not a bad idea to do this at the beginning of each new session.
Sometimes this is not enough - make sure that if you moved your .dsw or .dsp files from another location that you also moved the .opt file with it, for it is known to cause the Class Browser to fail miserably at times.
Worse comes to worse, delete your .opt file as well, and try that out - but keep in mind that the .opt file contains all the project-specific user customizations you've made, and you'll have to put them back in. This includes things like which libraries you're linking with, and compiler-command line options.
Sadly enough, problems in the Class Browser are sometimes indicative of problems in code - not that the code is invalid, simply that Microsoft's version of C/C++ isn't always a 1 to 1 match with the standard definition of those languages. In some cases, you can even get incredibly lucky and get the compiler to accept code that causes the CB to break - but closely examine this code if you can find it. Chances are, MSVC is going to have problems with it down the road.
![]() |
Index | ![]() |
7.1.2 Color | 7.1.4 Abara-Ka-Pragma |