PRB: ClassWizard Disables Add Function & Add Variable Buttons

Last reviewed: July 10, 1997
Article ID: Q140252
The information in this article applies to:
  • The ClassWizard included with: Microsoft Visual C++, 32-bit Edition, version 4.00

SYMPTOMS

If either the header (.h) or implementation (.cpp) file for a class is a read-only file, the following buttons will be grayed out in ClassWizard:

  • Add Function button on the Message Map tab.
  • Add Variable button on Member Variables tab.
  • Add Method and Add Property buttons on the OLE Automation tab.
  • Add Event button on the OLE Event tab.

Having a project's .odl file tagged as read-only causes the same behavior, and having the .clw file tagged as read-only produces this message:

   The ClassWizard database <path to the .clw file> is read-only.
   ClassWizard cannot continue.

CAUSE

This is by design. ClassWizard checks the attributes of the header and implementation files for a class when a class is selected from the Class Name combo box. If either file is read-only, ClassWizard can't add a new method, function, or variable to the file, so the buttons are disabled.

RESOLUTION

A simple workaround is to remove the read-only attribute from those files.

STATUS

This behavior is by design.


Keywords : kbtool kbui ssint ssvc WizardIss
Technology : kbMfc
Version : 4.0
Platform : NT WINDOWS
Issue type : kbprb


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 10, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.