It is mainly used to verify the content of errors reported by VC ++ 6.0 in various situations.
For the tutorial background, see:
(1) Create an MFC Appwizard Project
(2) content in tstextn. h
(3) content in tstextn. c
(4) Call functions in the C file in a CPP File
(5) Remove the pre-compiled header of tstextn. C.
The first step is not to define the type of the upper-case bool (Note: In MFC, the upper-case bool is defined as the int type)
Because the C language is used for compilation, the program reports the following error: we can see that the compiler does not know the upper-case bool in extern "C.
In tstextn. H, open the bool type definition and you can use it. Because tstextn. H is included in the. cpp file, if the type of the large bool is defined as a type other than int, such as char, at this time. It will cause confusion of the large bool type in MFC. In this experiment, the type of the big bool in tstextn. h and tstextn. C is defined as Int.
If # include "stdafx. H" is written at the beginning of tstextn. H (this is a common method to solve C ++/C Mixed encoding in VC), the following error is reported:
Compiling...
Tstextn. c
D:/program files/Microsoft Visual Studio/vc98/mfc/include/afx. H (15 ):
Fatal error c1189: # error: MFC requires C ++ compilation (Use A. cpp suffix)
Error executing cl.exe.
Creating browse info file...
BSCMAKE: Error bk1506: cannot open file './debug/tstextn. SBR': no such file or directory
Error executing bscmake.exe.
It is proved that when # include "stdafx. H" is added, you must change the file suffix to *. cpp.