You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This tutorial walks you step-by-step through a nonattributed ATL project that creates an ActiveX object that displays a polygon. The object includes options for allowing the user to change the number of sides making up the polygon, and code to refresh the display.
10
-
11
-
> [!NOTE]
12
-
> ATL and MFC are not generally supported in the Express editions of Visual Studio.
9
+
This tutorial walks you step-by-step through a non-attributed ATL project that creates an ActiveX object that displays a polygon. The object includes options for allowing the user to change the number of sides making up the polygon, and code to refresh the display.
13
10
14
11
> [!NOTE]
15
12
> This tutorial creates the same source code as the Polygon sample. If you want to avoid entering the source code manually, you can download it from the [Polygon sample abstract](https://github.com/Microsoft/VCSamples/tree/master/VC2008Samples/ATL/Controls/Polygon). You can then refer to the Polygon source code as you work through the tutorial, or use it to check for errors in your own project.
Copy file name to clipboardExpand all lines: docs/ide/walkthrough-working-with-projects-and-solutions-cpp.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ To create a project, first choose a project-type template. For each project type
26
26
27
27
1. From the main menu, choose **File** > **New** > **Project** to open the **Create a New Project** dialog box.
28
28
29
-
1. At the top of the dialog, set **Language** to **C++**, set **Platform** to **Windows**, and set **Project type** to **Console**.
29
+
1. At the top of the dialog, set **Language** to **C++**, set **Platform** to **Windows**, and set **Project type** to **Console**.
30
30
31
31
1. From the filtered list of project types, choose **Console App** then choose **Next**. In the next page, enter *Game* as the name for the project.
32
32
@@ -248,7 +248,7 @@ Next, build the project and run the app.
248
248
249
249
Congratulations, you've successfully built an app project and solution. Continue the walkthrough to learn more about how to build C++ code projects in Visual Studio.
250
250
251
-
## Next Steps
251
+
## Next steps
252
252
253
253
**Previous:** [Using the Visual Studio IDE for C++ Desktop Development](../ide/using-the-visual-studio-ide-for-cpp-desktop-development.md)<br/>
254
254
**Next:** [Walkthrough: Building a Project (C++)](../ide/walkthrough-building-a-project-cpp.md)
If you have already created an MFC-based application, then you can add support for the Active Template Library (ATL) easily by running the Add ATL Support to MFC Project Wizard.
11
-
12
-
> [!NOTE]
13
-
> ATL and MFC are not generally supported in the Express editions of Visual Studio.
10
+
If you have already created an MFC-based application, then you can add support for the Active Template Library (ATL) easily by using the IDE.
14
11
15
12
> [!NOTE]
16
13
> This support applies only to simple COM objects added to an MFC executable or DLL project. You can add other COM objects (including ActiveX controls) to MFC projects, but the objects might not operate as expected.
17
14
15
+
::: moniker range=">=vs-2019"
16
+
17
+
1. In Solution Explorer, right-click the project node.
18
+
19
+
1. On the shortcut menu, click **Add**, and then click **New Item**.
20
+
21
+
1. Choose **ATL** in the left pane, then choose **ATL Support** in the center pane.
22
+
23
+
::: moniker-end
24
+
25
+
::: moniker range="<=vs-2017"
26
+
18
27
### To add ATL support to your MFC project
19
28
20
-
1. In Solution Explorer, right-click the project to which you want to add ATL support.
29
+
1. In Solution Explorer, right-click the project node.
21
30
22
31
1. On the shortcut menu, click **Add**, and then click **Add Class**.
23
32
24
-
1. Select the **Add ATL Support to MFC Project** icon.
25
-
26
-
> [!NOTE]
27
-
> This icon is located in the ATL folder in the **Categories** pane.
33
+
1. Select **ATL** in the left pane, then choose **Add ATL Support to MFC Project** in the center pane.
28
34
29
-
1. When prompted, click **Yes** to add ATL support.
35
+
::: moniker-end
30
36
31
37
For more information about how adding ATL support changes your MFC project's code, see [Details of ATL Support Added by the ATL Wizard](../../mfc/reference/details-of-atl-support-added-by-the-atl-wizard.md)
@@ -19,38 +19,38 @@ SDI, MDI, and multiple top-level document applications are all forms based and u
19
19
20
20
Any dialog-based application, by definition, is forms based. A dialog-based application does not use the document/view architecture, so you must manage the creation and access methods for your own additional forms.
21
21
22
-
The base class for form-based applications is [CFormView](../../mfc/reference/cformview-class.md). If your application has database support, then you can also select any class that derives from `CFormView`. A form is any window derived from `CFormView` or from any class that inherits from `CFormView`.
22
+
The base class for form-based applications is [CFormView](cformview-class.md). If your application has database support, then you can also select any class that derives from `CFormView`. A form is any window derived from `CFormView` or from any class that inherits from `CFormView`.
23
23
24
-
Even if you use a base class such as [CView](../../mfc/reference/cview-class.md), you can later make your applications forms-based by [adding an MFC class](../../mfc/reference/adding-an-mfc-class.md) derived from `CFormView` and checking the **Generate DocTemplate resources** checkbox in the [MFC Class Wizard](../../mfc/reference/document-template-strings-mfc-add-class-wizard.md).
24
+
Even if you use a base class such as [CView](cview-class.md), you can later make your applications forms-based by [adding an MFC class](adding-an-mfc-class.md) derived from `CFormView` and checking the **Generate DocTemplate resources** checkbox in the [MFC Class Wizard](document-template-strings-mfc-add-class-wizard.md).
25
25
26
26
Once you finish with the wizard, your project opens, and if you selected `CFormView` (or a class that inherits from `CFormView`) as your base class or if you created a dialog-based application, Visual C++ opens the dialog editor. At this point, you are ready to design your first form.
27
27
28
28
### To begin creating a forms-based MFC executable
29
29
30
-
1. Follow the directions in [Creating an MFC Application](../../mfc/reference/creating-an-mfc-application.md).
30
+
1. Follow the directions in [Creating an MFC Application](creating-an-mfc-application.md) for a forms-based MFC application.
31
31
32
-
1. In the MFC Application Wizard [Application Type](../../mfc/reference/application-type-mfc-application-wizard.md) page, select the **Document/view architecture support** check box.
32
+
1. In the MFC Application Wizard [Application Type](application-type-mfc-application-wizard.md) page, select the **Document/view architecture support** check box.
33
33
34
34
1. Select **Single document**, **Multiple documents**, or **Multiple top-level documents**.
35
35
36
36
> [!NOTE]
37
-
> If you chose a SDI, MDI, or multiple top-level document interface application, by default, `CView` is set as the base class for your application's view in the [Generated Classes](../../mfc/reference/generated-classes-mfc-application-wizard.md) page of the wizard. To create a forms-based application, you must select `CFormView` as the base class for the application's view. Note that the wizard provides no printing support for a forms-based application.
37
+
> If you chose a SDI, MDI, or multiple top-level document interface application, by default, `CView` is set as the base class for your application's view in the [Generated Classes](generated-classes-mfc-application-wizard.md) page of the wizard. To create a forms-based application, you must select `CFormView` as the base class for the application's view. Note that the wizard provides no printing support for a forms-based application.
38
38
39
39
1. Set any other project options you want on the other pages of the wizard.
40
40
41
41
1. Click **Finish** to generate the skeleton application.
@@ -16,9 +16,7 @@ The easiest way to create an MFC ActiveX control is to use the [MFC ActiveX Cont
16
16
17
17
### To create an MFC ActiveX Control using the MFC ActiveX Control Wizard
18
18
19
-
1. Follow the instructions in the help topic [Create a C++ console app project](../../get-started/tutorial-console-cpp.md).
20
-
21
-
1. In the **New Project** dialog box, select the **MFC ActiveX Control** icon in the Templates pane to open the MFC ActiveX Control Wizard.
19
+
1. Follow the instructions in the help topic [Creating an MFC Application](creating-an-mfc-application.md) but choose **MFC ActiveX Control** from the list of available templates.
22
20
23
21
1. Define your [application settings](../../mfc/reference/application-settings-mfc-activex-control-wizard.md), [control names](../../mfc/reference/control-names-mfc-activex-control-wizard.md), and [control settings](../../mfc/reference/control-settings-mfc-activex-control-wizard.md) using the MFC ActiveX Control Wizard.
An MFC application is an executable application for Windows that is based on the Microsoft Foundation Class (MFC) Library. The easiest way to create an MFC application is to use the MFC Application Wizard (**MFC App project** in Visual Studio 2019). To create an MFC console application, use the Windows Desktop Wizard and choose the **Console Application** and **MFC Headers** options.
10
-
11
-
> [!IMPORTANT]
12
-
> MFC projects are not supported in Visual Studio Express editions.
13
-
14
-
MFC executables generally fall into five types: standard Windows applications, dialog boxes, forms-based applications, Explorer-style applications, and Web browser-style applications. For more information, see:
9
+
An MFC application is an executable application for Windows that is based on the Microsoft Foundation Class (MFC) Library. MFC executables generally fall into five types: standard Windows applications, dialog boxes, forms-based applications, Explorer-style applications, and Web browser-style applications. For more information, see:
15
10
16
11
-[Using the Classes to Write Windows Applications](../../mfc/using-the-classes-to-write-applications-for-windows.md)
17
12
@@ -25,23 +20,90 @@ MFC executables generally fall into five types: standard Windows applications, d
25
20
26
21
The MFC Application Wizard generates the appropriate classes and files for any of these types of applications, depending on the options you select in the wizard.
27
22
28
-
### To create an MFC application using the MFC Application Wizard
29
23
30
-
1. Follow the instructions in the help topic [Create a C++ console app project](../../get-started/tutorial-console-cpp.md).
24
+
The easiest way to create an MFC application is to use the MFC Application Wizard (**MFC App project** in Visual Studio 2019). To create an MFC console application (a command-line program that uses MFC libraries but runs in the console window), use the Windows Desktop Wizard and choose the **Console Application** and **MFC Headers** options.
25
+
26
+
::: moniker range=">=vs-2019"
27
+
28
+
## To create an MFC forms or dialog-based application
29
+
30
+
1. From the main menu, choose **File** > **New** > **Project**.
31
+
1. Enter "MFC" into the search box and then choose **MFC App** from the result list.
32
+
1. Modify the defaults as needed, then press **Create** to open the **MFC Application Wizard**.
33
+
1. Modify the configuration values as needed, then press **Finish**.
34
+
35
+
For more information, see [Creating a Forms-Based MFC Application](creating-a-forms-based-mfc-application.md).
An MFC console application is a command-line program that uses MFC libraries but runs in the console window.
95
+
96
+
1. From the main menu, choose **File** > **New** > **Project**.
97
+
1. Under the **Installed** templates, choose **Visual C++** > **Win32**.
98
+
1. Choose **Win32 Console Application** from the center pane.
99
+
1. Modify the project name as needed, then press **OK**.
100
+
1. On the second page of the wizard, check the **Add common headers for MFC** box and set other values as needed, then press **Finish**.
101
+
102
+
::: moniker-end
40
103
41
104
Once your project is created, you can view the files created in **Solution Explorer**. For more information about the files the wizard creates for your project, see the project-generated file ReadMe.txt. For more information about the file types, see [File Types Created for Visual Studio C++ projects](../../build/reference/file-types-created-for-visual-cpp-projects.md).
42
105
43
106
## See also
44
107
45
108
[Adding Functionality with Code Wizards](../../ide/adding-functionality-with-code-wizards-cpp.md)<br/>
@@ -14,9 +14,7 @@ An MFC DLL is a binary file that acts as a shared library of functions that can
14
14
15
15
### To create an MFC DLL Project using the MFC DLL Wizard
16
16
17
-
1. Follow the instructions in the help topic [Create a C++ console app project](../../get-started/tutorial-console-cpp.md).
18
-
19
-
**Note** In the **New Project** dialog box, select the `MFC DLL` icon in the Templates pane to open the MFC DLL Wizard.
17
+
1. Follow the instructions in the help topic [Creating an MFC Application](creating-an-mfc-application.md) but choose **MFC Dynamic Link Library** or **MFC DLL** from the list of available templates.
20
18
21
19
1. Define your application settings using the [application settings](../../mfc/reference/application-settings-mfc-dll-wizard.md) page of the [MFC DLL Wizard](../../mfc/reference/mfc-dll-wizard.md).
0 commit comments