PRB: Compiler Warnings Using #import on Mshtml.tlb

ID: Q231931


The information in this article applies to:


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:


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, please see the MSDN Web Workshop:

http://msdn.microsoft.com/workshop/default.asp

Additional query words:


Keywords          : kbDHTML kbMSHTML kbVC600 kbGrpInet kbIE500 
Version           : WINDOWS:5.0; winnt:6.0
Platform          : WINDOWS winnt 
Issue type        : kbprb 

Last Reviewed: June 24, 1999