How I fixed it (deleting .ncb / .suo / .user files and rebuilds did not help) ...
I noticed the following feature when this error occurred in my VS 2008 project:
- This happened in one dialogue + class, and not in others.
- In the .cpp class file for the broken dialog box in the area selector there is only the "(Global Scope)" element, there were no other lines (there was no expected class).
- I also checked the .h class file and visibility selector. OK.
I first fixed this problem in # 2 (explained below), then VS came out, deleted the * .ncb, * .suo files, restarted VS, rebuilt the project, and the wizards started working again.
To fix the visibility selector issue in # 2, I first narrowed it down to headers not included in the class .h file, i.e. I had some types used inside the class declaration, but not a single heading in the .h file that declared these types. Therefore, if I included the .h file in a clean .cpp file, it would not compile. The rest of the project was compiled because all the necessary files were added to all the corresponding .cpp files before the .h class. After I added all the necessary headers to the beginning of the .h class (this will compile a clean .cpp file), the area selector in the .cpp file is correctly inserted and, in turn, the wizard corrected.
On the side: there is a school of thought to not include any other .h files in any of the .h files, and Microsoft seems to follow this path quite often (fortunately, not always). I usually follow various inclusion rules - always include the headers with all the used ads in the .h file, so when I need to use the module, I only need to include its .h file. In the rare case when I didnβt do this, VS wizard clogged (or IntelliSense was clogged by this wizard). This makes my attachment to this inclusion policy stronger. The only exception to this policy is not to place stdafx.h, windows, and MFC files in a .h file. This is done differently due to precompiled headers.
iva2k
source share