BUG: C4003 When Building Wrapper For Word.Basic 7.0 Object

Last reviewed: July 14, 1997
Article ID: Q148223
The information in this article applies to:
  • The ClassWizard included with: - Microsoft Visual C++, 32-bit Edition, versions 2.0, 2.1, 2.2, 4.0, 5.0

SYMPTOMS

Attempting to build the ClassWizard-generated wrapper for the Word.Basic object by using the type library included with the Microsoft Word 95 Developer Kit (Wb70en32.tlb) results in this error:

   warning C4003: not enough actual parameters for macro 'ExitWindows'

CAUSE

This problem is actually caused by a macro defined in the Windows SDK header file Winuser.h. Winuser.h redefines ExitWindows() to map to the Win32 SDK API ExitWindowsEx(). This poses a problem for any C++ classes that need to implement a member function named ExitWindows(). The Word.Basic object exposes an automation method called ExitWindows(). When ClassWizard reads the type information contained in the Word type library (Wb70en32.tlb), it generates a class containing a member function called ExitWindows(). Attempting to compile this class generates the C4003 error.

RESOLUTION

Here are two ways to work around this problem. If your application doesn't make use of the ExitWindows() SDK function, you can undefine the macro by including the following line of code before the definition of the class that contains the ExitWindows() member function.

   #undef ExitWindows

However, a more straightforward workaround is to rename the ExitWindows() member function for the problem class. For example, rename WordBasic::ExitWindows() to WordBasic::_ExitWindows().

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Keywords : vcbuglist500 WizardIss
Technology : kbole
Version : 2.0 2.1 2.2 4.0 5.0
Platform : NT WINDOWS
Issue type : kbbug


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 14, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.