Description of the MIDL2362 warning in Visual C++ (241849)



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
  • Microsoft Visual C++ .NET (2002)
  • Microsoft Visual C++ .NET (2003)
  • 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:
#if (__midl >= 501)
midl_pragma warning( disable: 2362 )
#endif
				
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.

REFERENCES

170989 Large Number of Methods in an OLE Interface Causes Failure


In MSDN, midl_pragma warning

Modification Type:MajorLast Reviewed:1/9/2006
Keywords:kbCompiler kbinfo KB241849 kbAudDeveloper