Microsoft KB Archive/231931

= PRB: Compiler Warnings Using #import on Mshtml.tlb =

Article ID: 231931

Article Last Modified on 5/11/2006

-

APPLIES TO


 * Microsoft Visual C++ 6.0 Enterprise Edition
 * Microsoft Visual C++ 6.0 Professional Edition
 * Microsoft Visual C++ 6.0 Standard Edition

-



This article was previously published under Q231931



SYMPTOMS
Building a Visual C++ project that uses #import on Mshtml.tlb may result in a number of compiler warnings of type C4192, C4049, and C4146:

warning C4192: automatically excluding 'wireHDC' while importing type library 'c:\winnt\system32\mshtml.tlb'

-or-

warning C4049: compiler limit : terminating line number emission

-or-

warning C4146: unary minus operator applied to unsigned type, result still unsigned



CAUSE
All of these warnings are indications of normal conditions inside the MSHTML type library:
 * C4192 is a typical warning, as indicated in the documentation for "C4192."
 * C4049 results from Mshtml.tlb's large size.
 * C4146 is an indication of the usage of a negative sign in the FINDTEXT_FLAGS enumeration. This is a low impact bug in the MSHTML type library and can be safely ignored.



RESOLUTION
Ignore these warnings or use #pragma to prevent them while #importing Mshtml.tlb:


 * 1) pragma warning(disable : 4192)
 * 2) pragma warning(disable : 4049)
 * 3) pragma warning(disable : 4146)
 * 4) import 
 * 5) pragma warning(default: 4192)
 * 6) pragma warning(default: 4049)
 * 7) pragma warning(default: 4146)



STATUS
This behavior is by design.



MORE INFORMATION
Note that the type library for MSHTML in Internet Explorer 4 was stored inside Mshtml.dll. As of Internet Explorer 5, the type library is provided in a separate file, Mshtml.tlb.

