pop out so many errors, which seemed don't even exist:
--------------------Configuration: 12 - Win32 Debug--------------------
Compiling...
StdAfx.cpp
c:\program files\microsoft visual studio\vc98\include\winuser.h(3) : error C2143: syntax error : missing ';' before '.'
c:\program files\microsoft visual studio\vc98\include\winuser.h(3) : error C2501: 'winuser' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\winuser.h(3) : error C2143: syntax error : missing ';' before '.'
c:\program files\microsoft visual studio\vc98\include\winuser.h(27) : error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio\vc98\include\winuser.h(27) : error C2447: missing function header (old-style formal list?)
c:\program files\microsoft visual studio\vc98\include\winuser.h(7127) : error C2014: preprocessor command must start as first nonwhite space
c:\program files\microsoft visual studio\vc98\include\winuser.h(7474) : error C2001: newline in constant
c:\program files\microsoft visual studio\vc98\include\winuser.h(8267) : error C2014: preprocessor command must start as first nonwhite space
c:\program files\microsoft visual studio\vc98\include\winuser.h(8292) : error C2014: preprocessor command must start as first nonwhite space
c:\program files\microsoft visual studio\vc98\include\winuser.h(8300) : error C2014: preprocessor command must start as first nonwhite space
c:\program files\microsoft visual studio\vc98\include\winuser.h(8309) : error C2014: preprocessor command must start as first nonwhite space
c:\program files\microsoft visual studio\vc98\include\winuser.h(8526) : error C2014: preprocessor command must start as first nonwhite space
c:\program files\microsoft visual studio\vc98\include\winuser.h(8529) : error C2014: preprocessor command must start as first nonwhite space
c:\program files\microsoft visual studio\vc98\include\winuser.h(8534) : error C2014: preprocessor command must start as first nonwhite space
c:\program files\microsoft visual studio\vc98\include\winuser.h(9427) : fatal error C1070: mismatched #if/#endif pair in file 'c:\program files\microsoft visual studio\vc98\include\winuser.h'
Error executing cl.exe.
12.exe - 15 error(s), 0 warning(s)

Dani AI

Generated

The symptoms reported by - syntax errors inside Microsoft headers while compiling the precompiled header - strongly suggest the compiler got into a broken parse state before or while including the system headers. As hinted, this is usually caused by something in the project (unterminated string/comment, a macro that expands badly, corrupted precompiled header, or an encoding/BOM issue), not by an intentional edit of winuser.h.

Suggested diagnostics (in order):

  1. Remove any existing precompiled header and object files for the project and do a full rebuild (delete .pch/.obj or use a clean/rebuild).
  2. Temporarily reduce stdafx.h to the minimal test case and rebuild:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

If this compiles, add back the project's headers one at a time to find the offender.
3) Check stdafx.h and the first headers it includes for an unclosed string, unclosed comment, or stray character BEFORE the #include lines. Re-save those files as plain ANSI (no UTF-8 BOM). A UTF-8 BOM or nonprintable byte at the top of a file can cause the "preprocessor command must start" / "newline in constant" cascade.
4) Generate preprocessed output for StdAfx.cpp (compiler option /P or VS "Preprocess to a File") and inspect where parsing first goes wrong; that reveals whether a string/comment is left open or a macro expansion is corrupting subsequent lines.

Also check include-path collisions (search project folders for another copy of winuser.h) and scan for macros with common names that could collide with Windows tokens; if found, #undef the macro before including system headers or rename the macro. If a minimal project including only <windows.h> still fails, the VC headers may be corrupted and a repair/replace of the toolchain files is appropriate. Avoid editing system headers directly. These steps typically isolate the problematic header or encoding issue quickly.

It must be somthing in your source code which might be causing this problem.

Also mention the files which are present in your current project.

Did you mess with the settings of the directories and so on.

Post entire thing, and we will see what can be done.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.