Udostępnij za pośrednictwem


Adding a Class

To add a class in your Visual C++ project, display the Add Class dialog box by right-clicking the project in either Solution Explorer or Class View. From the shortcut menu, click Add, and then click Add Class.

When you add a class, you must specify a name that is different from classes already existing in MFC or ATL. If you specify a name that already exists in either library, Visual C++ displays an error message indicating that the specified name is reserved.

If your project naming convention requires you to use an existing name, then you can change the letter case, because Visual C++ is case sensitive. That is, you can name a class cdocument, but you cannot name a class CDocument.

What kind of class do you want to add?

See Also

Tasks

Creating Projects with Application Wizards

Concepts

Adding Functionality with Code Wizards

Reference

Add Class Dialog Box