Article ID: 311407 - View products that this article applies to.
This article was previously published under Q311407
This article has been archived. It is offered "as is" and will no longer be updated.
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.