You might have an actual syntax error, a header dependency problem, or something else. My personal rules for header includes are:
- If precompiled headers are used, the first #include in a .cpp file should be "stdafx.h" (or equiv). This include should never be in a .h file.
- Immediately following the PCH header #include should be the header corresponding to the current file. This will force you to include any system headers in the .h file that are required by that .h file (and will fix many problems with include ordering).
- Following this #include, add any other of your project files needed by the .cpp file to compile correctly (in any order you want; I usually do it alphabetically).
- Following these #includes, add any system headers (ie. that ship with the compiler) that are needed by the .cpp file to compile correctly again, in any order that you want. Note that there are some system headers that have ordering trouble, notably with stl and the min()/max() macros.
Using these rules, the result above would be:
#include "stdafx.h"
#include "MyDialog.h"
#include "MFCOne.h"
#include "MFCOneView.h"
#include "afxdialogex.h"
Doing this should either fix your problem or do a better job showing you where the problem lies...