Microsoft KB Archive/241849

= Description of the MIDL2362 warning in Visual C++ =

Article ID: 241849

Article Last Modified on 1/9/2006

-

APPLIES TO


 * Microsoft Visual C++ 6.0 Enterprise Edition
 * Microsoft Visual C++ 6.0 Professional Edition
 * Microsoft Visual C++ 6.0 Standard Edition
 * Microsoft Visual C++ .NET 2002 Standard Edition
 * Microsoft Visual C++ .NET 2003 Standard Edition
 * Microsoft Visual C++ 2005 Express Edition

-



This article was previously published under Q241849



Note Microsoft Visual C++ .NET 2002 and Microsoft Visual C++ .NET 2003 support both the managed code model that is provided by the Microsoft .NET Framework and the unmanaged native Microsoft Windows code model. The information in this article applies only to unmanaged Visual C++ code. Microsoft Visual C++ 2005 supports both the managed code model that is provided by the Microsoft .NET Framework and the unmanaged native Microsoft Windows code model.



SUMMARY
When compiling Interface Definition Language (IDL) code that has an OLE automation dual interface with more than 110 methods, the Microsoft Interface Definition Language (MIDL) compiler gives a MIDL2362 warning. The exact text of the warning is as follows:

warning MIDL2362 : too many methods in the interface, requires Windows NT 4.0 SP3 or greater.

This happens on computers with Microsoft Windows NT and that have the latest service pack installed.



MORE INFORMATION
The warning states that the number of methods in the dual interface is greater than what Windows NT 4.0 without any service packs can support. If service pack 3 or higher is installed on the target Windows NT 4.0 computers, then the warning can be ignored. The MIDL compiler does not check the service pack level of Windows NT on the development computer. Therefore, the compiler gives the warning if more than 110 methods are in the dual automation interface even if SP3, SP4 or SP5 is on the development computer.

You can disable this warning if you use the following code before the offending interface: midl_pragma warning( disable: 2362 ) This requires a version of Midl.exe that is 5.01.0000 or higher. You can check the version of the MIDL compiler on the computer by running Midl.exe from the command line.
 * 1) if (__midl >= 501)
 * 1) endif

