Skip to content

Commit 3a44742

Browse files
author
Colin Robertson
committed
Fix bullet, adjust H3->H2, minor edits
1 parent f0c31ea commit 3a44742

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

‎docs/mfc/walkthrough-adding-a-d2d-object-to-an-mfc-project.md‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ The walkthrough shows how to accomplish these tasks:
3333

3434
To complete this walkthrough, you must have Visual Studio installed with the **Desktop development with C++** workload and the optional **Visual C++ MFC for x86 and x64** component.
3535

36-
### To create an MFC application
36+
## To create an MFC application
3737

38-
1. On the **File** menu, point to **New** and then click **Project**.
38+
1. On the **File** menu, point to **New** and then choose **Project**.
3939

40-
2. In the **New Project** dialog box, in the left pane under **Installed Templates**, expand **Visual C++** and then select **MFC**. In the middle pane, select **MFC Application**. In the **Name** box, type `MFCD2DWalkthrough`. Click **OK**.
40+
2. In the **New Project** dialog box, in the left pane under **Installed Templates**, expand **Visual C++** and then select **MFC**. In the middle pane, select **MFC Application**. In the **Name** box, type `MFCD2DWalkthrough`. Choose **OK**.
4141

42-
3. In the **MFC Application Wizard**, click **Finish** without changing any settings.
42+
3. In the **MFC Application Wizard**, choose **Finish** without changing any settings.
4343

44-
### To create a solid-color brush and a linear-gradient brush
44+
## To create a solid-color brush and a linear-gradient brush
4545

46-
1. In **Solution Explorer**, in the **MFCD2DWalkthrough** project, in the **Header Files** folder, open MFCD2DWalkthroughView.h. Add the following code to the `CMFCD2DWalkthroughView` class to create three data variables.
46+
1. In **Solution Explorer**, in the **MFCD2DWalkthrough** project, in the **Header Files** folder, open MFCD2DWalkthroughView.h. Add this code to the `CMFCD2DWalkthroughView` class to create three data variables:
4747

4848
```cpp
4949
CD2DTextFormat* m_pTextFormat;
@@ -53,7 +53,7 @@ To complete this walkthrough, you must have Visual Studio installed with the **D
5353

5454
Save the file and close it.
5555

56-
2. In the **Source Files** folder, open MFCD2DWalkthroughView.cpp. In the constructor for the `CMFCD2DWalkthroughView` class, add the following code.
56+
2. In the **Source Files** folder, open MFCD2DWalkthroughView.cpp. In the constructor for the `CMFCD2DWalkthroughView` class, add this code:
5757

5858
```cpp
5959
// Enable D2D support for this window:
@@ -97,33 +97,33 @@ To complete this walkthrough, you must have Visual Studio installed with the **D
9797
9898
Save the file and close it.
9999
100-
### To modify the gradient brush so that it will change appropriately when the window is resized
100+
## To modify the gradient brush so that it will change appropriately when the window is resized
101101
102-
1. On the **Project** menu, click **Class Wizard**.
102+
1. On the **Project** menu, choose **Class Wizard**.
103103
104104
2. In the **MFC Class Wizard**, under **Class name**, select `CMFCD2DWalkthroughView`.
105105
106-
3. On the **Messages** tab, in the **Messages** box, select `WM_SIZE` and then click **Add Handler**. This action adds the `OnSize` message handler to the `CMFCD2DWalkthroughView` class.
106+
3. On the **Messages** tab, in the **Messages** box, select `WM_SIZE` and then choose **Add Handler**. This action adds the `OnSize` message handler to the `CMFCD2DWalkthroughView` class.
107107
108-
4. In the **Existing handlers** box, select `OnSize`. Click **Edit Code** to display the `CMFCD2DWalkthroughView::OnSize` method. At the end of the method, add the following code.
108+
4. In the **Existing handlers** box, select `OnSize`. Choose **Edit Code** to display the `CMFCD2DWalkthroughView::OnSize` method. At the end of the method, add the following code.
109109
110110
```cpp
111111
m_pLinearGradientBrush->SetEndPoint(CPoint(cx, cy));
112112
```
113113

114114
Save the file and close it.
115115

116-
### To implement a D2D drawing handler
116+
## To implement a D2D drawing handler
117117

118-
1. On the **Project** menu, click **Class Wizard**.
118+
1. On the **Project** menu, choose **Class Wizard**.
119119

120120
2. In the **MFC Class Wizard**, under **Class name**, select `CMFCD2DWalkthroughView`.
121121

122-
3. On the **Messages** tab, click **Add Custom Message**.
122+
3. On the **Messages** tab, choose **Add Custom Message**.
123123

124-
4. In the **Add Custom Message** dialog box, in the **Custom Windows Message** box, type `AFX_WM_DRAW2D`. In the **Message handler name** box, type `OnDraw2D`. Select the **Registered Message** option and then click **OK**. This action adds a message handler for the `AFX_WM_DRAW2D` message to the `CMFCD2DWalkthroughView` class.
124+
4. In the **Add Custom Message** dialog box, in the **Custom Windows Message** box, type `AFX_WM_DRAW2D`. In the **Message handler name** box, type `OnDraw2D`. Select the **Registered Message** option and then choose **OK**. This action adds a message handler for the `AFX_WM_DRAW2D` message to the `CMFCD2DWalkthroughView` class.
125125

126-
5. In the **Existing handlers** box, select `OnDraw2D`. Click **Edit Code** to display the `CMFCD2DWalkthroughView::OnDraw2D` method. Use the following code for the `CMFCD2DWalkthroughView::OnDrawD2D` method.
126+
5. In the **Existing handlers** box, select `OnDraw2D`. Choose **Edit Code** to display the `CMFCD2DWalkthroughView::OnDraw2D` method. Use this code for the `CMFCD2DWalkthroughView::OnDrawD2D` method:
127127

128128
```cpp
129129
afx_msg LRESULT CMFCD2DWalkthroughView::OnDraw2D(
@@ -150,9 +150,9 @@ To complete this walkthrough, you must have Visual Studio installed with the **D
150150
151151
Save the file and close it.
152152
153-
### To verify the results
153+
## To verify the results
154154
155-
1. Build and run the application. It should have a gradient rectangle that changes when you resize the window. “Hello World!” should be displayed in the center of the rectangle.
155+
- Build and run the application. It should have a gradient rectangle that changes when you resize the window. “Hello World!” should be displayed in the center of the rectangle.
156156
157157
## See also
158158

0 commit comments

Comments
 (0)