The information in this article applies to:
SYMPTOMSUsing some Win32 APIs, such as PurgeComm() and RegFlushKey(), in an AppWizard generated application will cause C2065 and C2064 compilation errors. For example, a call to the PurgeComm() function will produce the following errors:
CAUSE
In Visual C++ 4.x, AppWizard automatically adds a macro definition for
VC_EXTRALEAN to the project's precompiled header. Its purpose is to help
speed up compilation by excluding less-frequently used declarations from
the various Windows header files.
Because the macro NOCOMM is being defined, the prototype for PurgeComm() is
excluded. This behavior causes the errors.
RESOLUTION
One solution is to remove the #define VC_EXTRALEAN line from stdafx.h. This
keeps the Communication, Registry, and other areas of the Win32 APIs that
are not directly used by MFC in the project. STATUSThis behavior is by design. MORE INFORMATIONFor complete information on what the macros listed above exclude, search the windows.h and afxv_w32.h files for the symbols. Additional query words: 4.00 4.10
Keywords : kberrmsg kbnokeyword kbMFC kbVC |
Last Reviewed: July 29, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |