BUG: MFC Class Wizard Does Not Resolve Naming Conflicts Between Windows APIs and COM Interface Methods

Article translations Article translations
Article ID: 311407 - View products that this article applies to.
This article was previously published under Q311407
Expand all | Collapse all


If you use the Microsoft Foundation Classes (MFC) Add Class from TypeLib wizard in Microsoft Visual Studio .NET to add a wrapper class for a Component Object Model (COM) interface, and the interface contains a method with the same name as a Microsoft Windows application programming interface (API), you may receive a compile-time error message such as the following when you compile the project:
Warning C4003: Not enough actual parameters for macro <Method Name>


The Add Class from TypeLib Wizard fails to recognize that the COM interface for which it generates a wrapper class contains methods whose names conflict with existing macro names for Windows APIs.


To work around the problem, locate the line that is specified in the error message and add an underscore (_) to the method name that is causing the conflict, then save the file and recompile the project.


Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.


Previous versions of MFC correctly recognized this condition and appended an underscore (_) to the method name in the wrapper class, avoiding the name conflict while maintaining the functionality of the wrapper class.


Article ID: 311407 - Last Review: June 25, 2003 - Revision: 1.2
  • Microsoft Visual C++ .NET 2002 Standard Edition
  • Microsoft Visual C++ .NET 2003 Standard Edition
kbbug kbpending KB311407

Give Feedback


Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com