Renaming or Moving Classes

HomeOverviewHow Do ITutorial

When you change the name of a class or move it from one implementation file to another, you're prompted to update the information in the ClassWizard (.clw) file the next time you start ClassWizard.

To change the name of a class or move it from one file to another

  1. Make the desired changes to your source files.

    Note   When you change the name of a class, remember to change it everywhere, including in the special-format comments ClassWizard uses. For example:

    //{{AFX_MSG_MAP(OldClass) becomes //{{AFX_MSG_MAP(NewClass)
    
  2. On the View menu, click ClassWizard.

    If ClassWizard appears, the active project does not contain the renamed or moved class.

  3. From ClassWizard's Project drop-down list, select the project that contains the renamed or moved class.

  4. If ClassWizard asks you to close any files, close ClassWizard, close the files, and then restart ClassWizard.

    ClassWizard displays a message box warning you that the old class could not be found.

  5. Click OK.

    The Repair Class Information dialog box appears.

    Supply the new information about the class in the Class Name, Header File, and Implementation File text boxes. If necessary, use the Browse button to supply the correct name of the header file or the implementation file.

  6. Click OK to update the .clw file.

See Also   Keeping ClassWizard Updated When Code Changes, Deleting Classes, Rebuilding the ClassWizard (.clw) File