Article ID: 311407 - Last Review: June 25, 2003 - Revision: 1.2

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

This article was previously published under Q311407
Expand all | Collapse all

SYMPTOMS

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>

CAUSE

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.

RESOLUTION

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.

STATUS

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

MORE INFORMATION

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.

APPLIES TO
  • Microsoft Visual C++ .NET 2002 Standard Edition
  • Microsoft Visual C++ .NET 2003 Standard Edition
Keywords: 
kbbug kbpending KB311407
 

Article Translations

 

Related Support Centers