PRB: Compiler Warnings Using #import on Mshtml.tlb (231931)



The information in this article applies to:

  • Microsoft Visual C++, 32-bit Enterprise Edition 6.0
  • Microsoft Visual C++, 32-bit Professional Edition 6.0
  • Microsoft Visual C++, 32-bit Learning Edition 6.0

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:
#pragma warning(disable : 4192)
#pragma warning(disable : 4049)
#pragma warning(disable : 4146)
#import <mshtml.tlb>
#pragma warning(default: 4192)
#pragma warning(default: 4049)
#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.

REFERENCES

For more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:

Modification Type:MajorLast Reviewed:5/11/2006
Keywords:kbDHTML kbMSHTML kbprb KB231931