SUMMARY
The MIDL /char command line switch is used to ensure that the MIDL compiler
and the Visual C++ compiler operate together correctly for all char types.
By default, a MIDL char is unsigned whereas a default char in Visual C++ is
signed. The MIDL /char switch is used to force MIDL to generate signed or
unsigned chars and can be used to match the type generated by the Visual
C++ compiler.
The online documentation at keyword index /char states the following:
The /char signed option indicates that the C-compiler char type is
signed.
Using /char signed results in MIDL chars that are unsigned. Therefore, the
types will be mismatched and the project will not compile. Use /char
unsigned to generate MIDL signed chars.
The same documentation also states the following:
The /char unsigned option indicates that the C-compiler char type is
unsigned.
Using /char unsigned results in MIDL chars that are signed. Therefore, the
types will be mismatched and the project will not compile. Use /char signed
to generate MIDL unsigned chars.
For additional information, please see the following article in the
Microsoft Knowledge Base:
201094 PRB: Error C2259 on "char" Type Redefinition in Visual C++ ATL Project