Skip to content

Commit cadbda4

Browse files
author
mtx48109
committed
reformat mfc final
1 parent 33f9712 commit cadbda4

32 files changed

+128
-128
lines changed

docs/mfc/using-the-carchive-output-and-input-operators.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@ ms.workload: ["cplusplus"]
2727

2828
[!code-cpp[NVC_MFCSerialization#8](../mfc/codesnippet/cpp/using-the-carchive-output-and-input-operators_2.cpp)]
2929

30-
Usually, you store and load data to and from a file via an archive in the `Serialize` functions of `CObject`-derived classes, which you must have declared with the **DECLARE_SERIALIZE** macro. A reference to a `CArchive` object is passed to your `Serialize` function. You call the `IsLoading` function of the `CArchive` object to determine whether the `Serialize` function has been called to load data from the file or store data to the file.
30+
Usually, you store and load data to and from a file via an archive in the `Serialize` functions of `CObject`-derived classes, which you must have declared with the DECLARE_SERIALIZE macro. A reference to a `CArchive` object is passed to your `Serialize` function. You call the `IsLoading` function of the `CArchive` object to determine whether the `Serialize` function has been called to load data from the file or store data to the file.
3131

3232
The `Serialize` function of a serializable `CObject`-derived class typically has the following form:
3333

3434
[!code-cpp[NVC_MFCSerialization#9](../mfc/codesnippet/cpp/using-the-carchive-output-and-input-operators_3.cpp)]
3535

36-
The above code template is exactly the same as the one AppWizard creates for the `Serialize` function of the document (a class derived from **CDocument)**. This code template helps you write code that is easier to review, because the storing code and the loading code should always be parallel, as in the following example:
36+
The above code template is exactly the same as the one AppWizard creates for the `Serialize` function of the document (a class derived from `CDocument`). This code template helps you write code that is easier to review, because the storing code and the loading code should always be parallel, as in the following example:
3737

3838
[!code-cpp[NVC_MFCSerialization#10](../mfc/codesnippet/cpp/using-the-carchive-output-and-input-operators_4.cpp)]
3939

4040
The library defines **<\<** and **>>** operators for `CArchive` as the first operand and the following data types and class types as the second operand:
4141

4242
||||
4343
|-|-|-|
44-
|`CObject*`|**SIZE and CSize**|**float**|
44+
|`CObject*`|**SIZE** and `CSize`|**float**|
4545
|**WORD**|`CString`|**POINT** and `CPoint`|
4646
|`DWORD`|**BYTE**|`RECT` and `CRect`|
4747
|**Double**|**LONG**|`CTime` and `CTimeSpan`|

docs/mfc/using-the-dialog-editor-to-add-controls.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.author: "mblome"
1212
ms.workload: ["cplusplus"]
1313
---
1414
# Using the Dialog Editor to Add Controls
15-
When you create your dialog-template resource with the [dialog editor](../windows/dialog-editor.md), you drag controls from a controls palette and drop them into the dialog box. This adds the specifications for that control type to the dialog-template resource. When you construct a dialog object and call its **Create** or `DoModal` member function, the framework creates a Windows control and places it in the dialog window on screen.
15+
When you create your dialog-template resource with the [dialog editor](../windows/dialog-editor.md), you drag controls from a controls palette and drop them into the dialog box. This adds the specifications for that control type to the dialog-template resource. When you construct a dialog object and call its `Create` or `DoModal` member function, the framework creates a Windows control and places it in the dialog window on screen.
1616

1717
You can instead [create controls by hand](../mfc/adding-controls-by-hand.md) if you want. This is more work.
1818

docs/mfc/using-the-mfc-source-files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The Microsoft Foundation Class (MFC) Library supplies full source code. Header f
1616

1717
This family of articles explains the conventions that MFC uses to comment the various parts of each class, what these comments mean, and what you should expect to find in each section. The Visual C++ wizards use similar conventions for the classes that they create for you, and you will probably find these conventions useful for your own code.
1818

19-
You might be familiar with the **public**, `protected`, and `private` C++ keywords. When looking at the MFC header files, you will find that each class may have several of each of these. For example, public member variables and functions might be under more than one **public** keyword. This is because MFC separates member variables and functions based on their use, not by the type of access allowed. MFC uses `private` sparingly; even items considered implementation details are generally protected and many times are public. Although access to the implementation details is discouraged, MFC leaves the decision to you.
19+
You might be familiar with the **public**, **protected**, and **private** C++ keywords. When looking at the MFC header files, you will find that each class may have several of each of these. For example, public member variables and functions might be under more than one **public** keyword. This is because MFC separates member variables and functions based on their use, not by the type of access allowed. MFC uses **private** sparingly; even items considered implementation details are generally protected and many times are public. Although access to the implementation details is discouraged, MFC leaves the decision to you.
2020

2121
In both the MFC source files and the files that the MFC Application Wizard creates, you will find comments like these within class declarations (usually in this order):
2222

docs/mfc/using-tooltips-in-a-cstatusbarctrl-object.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ ms.author: "mblome"
1313
ms.workload: ["cplusplus"]
1414
---
1515
# Using Tooltips in a CStatusBarCtrl Object
16-
To enable tooltips for a status bar control, create the `CStatusBarCtrl` object with the **SBT_TOOLTIPS** style.
16+
To enable tooltips for a status bar control, create the `CStatusBarCtrl` object with the SBT_TOOLTIPS style.
1717

1818
> [!NOTE]
19-
> If you are using a `CStatusBar` object to implement your status bar, use the `CStatusBar::CreateEx` function. It allows you to specify additional styles for the embedded **CStatusBarCtrl** object.
19+
> If you are using a `CStatusBar` object to implement your status bar, use the `CStatusBar::CreateEx` function. It allows you to specify additional styles for the embedded `CStatusBarCtrl` object.
2020
2121
Once the `CStatusBarCtrl` object has been successfully created, use [CStatusBarCtrl::SetTipText](../mfc/reference/cstatusbarctrl-class.md#settiptext) and [CStatusBarCtrl::GetTipText](../mfc/reference/cstatusbarctrl-class.md#gettiptext) to set and retrieve the tip text for a specific pane.
2222

docs/mfc/using-tree-controls.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Typical usage of a tree control ([CTreeCtrl](../mfc/reference/ctreectrl-class.md
2020

2121
- Put data into the control by calling the `CTreeCtrl`'s [InsertItem](../mfc/reference/ctreectrl-class.md#insertitem) function once for each data item. `InsertItem` returns a handle to the item you can use to refer to it later, such as when adding child items. A good time to initialize the data is in `OnInitDialog` (for controls in dialog boxes) or `OnInitialUpdate` (for views).
2222

23-
- As the user interacts with the control, it will send various notification messages. You can specify a function to handle each of the messages you want to handle by adding an **ON_NOTIFY_REFLECT** macro in your control window's message map or by adding an `ON_NOTIFY` macro to your parent window's message map. See [Tree Control Notification Messages](../mfc/tree-control-notification-messages.md) later in this topic for a list of possible notifications.
23+
- As the user interacts with the control, it will send various notification messages. You can specify a function to handle each of the messages you want to handle by adding an ON_NOTIFY_REFLECT macro in your control window's message map or by adding an ON_NOTIFY macro to your parent window's message map. See [Tree Control Notification Messages](../mfc/tree-control-notification-messages.md) later in this topic for a list of possible notifications.
2424

2525
- Call the various Set member functions to set values for the control. Changes that you can make include setting the indentation and changing the text, image, or data associated with an item.
2626

docs/mfc/virtual-list-controls.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@ ms.author: "mblome"
1212
ms.workload: ["cplusplus"]
1313
---
1414
# Virtual List Controls
15-
A virtual list control is a list view control that has the **LVS_OWNERDATA** style. This style enables the control to support an item count up to a `DWORD` (the default item count only extends to an `int`). However, the biggest advantage provided by this style is the ability to only have a subset of data items in memory at any one time. This allows the virtual list view control to lend itself for use with large databases of information, where specific methods of accessing data are already in place.
15+
A virtual list control is a list view control that has the LVS_OWNERDATA style. This style enables the control to support an item count up to a **DWORD** (the default item count only extends to an **int**). However, the biggest advantage provided by this style is the ability to only have a subset of data items in memory at any one time. This allows the virtual list view control to lend itself for use with large databases of information, where specific methods of accessing data are already in place.
1616

1717
> [!NOTE]
1818
> In addition to providing virtual list functionality in `CListCtrl`, MFC also provides the same functionality in the [CListView](../mfc/reference/clistview-class.md) class.
1919
2020
There are some compatibility issues you should be aware of when developing virtual list controls. For more information, see the Compatibility Issues section of the List-View Controls topic in the Windows SDK.
2121

2222
## Handling the LVN_GETDISPINFO Notification
23-
Virtual list controls maintain very little item information. Except for the item selection and focus information, all item information is managed by the owner of the control. Information is requested by the framework via a **LVN_GETDISPINFO** notification message. To provide the requested information, the owner of the virtual list control (or the control itself) must handle this notification. This can easily be done using the Properties window (see [Mapping Messages to Functions](../mfc/reference/mapping-messages-to-functions.md)). The resultant code should look something like the following example (where `CMyDialog` owns the virtual list control object and the dialog is handling the notification):
23+
Virtual list controls maintain very little item information. Except for the item selection and focus information, all item information is managed by the owner of the control. Information is requested by the framework via a LVN_GETDISPINFO notification message. To provide the requested information, the owner of the virtual list control (or the control itself) must handle this notification. This can easily be done using the Properties window (see [Mapping Messages to Functions](../mfc/reference/mapping-messages-to-functions.md)). The resultant code should look something like the following example (where `CMyDialog` owns the virtual list control object and the dialog is handling the notification):
2424

2525
[!code-cpp[NVC_MFCControlLadenDialog#23](../mfc/codesnippet/cpp/virtual-list-controls_1.cpp)]
2626

27-
In the handler for the **LVN_GETDISPINFO** notification message, you must check to see what type of information is being requested. The possible values are:
27+
In the handler for the LVN_GETDISPINFO notification message, you must check to see what type of information is being requested. The possible values are:
2828

29-
- `LVIF_TEXT` The `pszText` member must be filled in.
29+
- `LVIF_TEXT` The *pszText* member must be filled in.
3030

31-
- `LVIF_IMAGE` The `iImage` member must be filled in.
31+
- `LVIF_IMAGE` The *iImage* member must be filled in.
3232

33-
- **LVIF_INDENT** The *iIndent* member must be filled in.
33+
- `LVIF_INDENT` The *iIndent* member must be filled in.
3434

3535
- `LVIF_PARAM` The *lParam* member must be filled in. (Not present for sub-items.)
3636

@@ -43,7 +43,7 @@ A virtual list control is a list view control that has the **LVS_OWNERDATA** sty
4343
[!code-cpp[NVC_MFCControlLadenDialog#24](../mfc/codesnippet/cpp/virtual-list-controls_2.cpp)]
4444

4545
## Caching and Virtual List Controls
46-
Because this type of list control is intended for large data sets, it is recommended that you cache requested item data to improve retrieval performance. The framework provides a cache-hinting mechanism to assist in optimizing the cache by sending an **LVN_ODCACHEHINT** notification message.
46+
Because this type of list control is intended for large data sets, it is recommended that you cache requested item data to improve retrieval performance. The framework provides a cache-hinting mechanism to assist in optimizing the cache by sending an LVN_ODCACHEHINT notification message.
4747

4848
The following example updates the cache with the range passed to the handler function.
4949

@@ -52,7 +52,7 @@ A virtual list control is a list view control that has the **LVS_OWNERDATA** sty
5252
For more information on preparing and maintaining a cache, see the Cache Management section of the List-View Controls topic in the Windows SDK.
5353

5454
## Finding Specific Items
55-
The **LVN_ODFINDITEM** notification message is sent by the virtual list control when a particular list control item needs to be found. The notification message is sent when the list view control receives quick key access or when it receives an **LVM_FINDITEM** message. Search information is sent in the form of an **LVFINDINFO** structure, which is a member of the **NMLVFINDITEM** structure. Handle this message by overriding the `OnChildNotify` function of your list control object and inside the body of the handler, check for the **LVN_ODFINDITEM** message. If found, perform the appropriate action.
55+
The LVN_ODFINDITEM notification message is sent by the virtual list control when a particular list control item needs to be found. The notification message is sent when the list view control receives quick key access or when it receives an LVM_FINDITEM message. Search information is sent in the form of an **LVFINDINFO** structure, which is a member of the **NMLVFINDITEM** structure. Handle this message by overriding the `OnChildNotify` function of your list control object and inside the body of the handler, check for the LVN_ODFINDITEM message. If found, perform the appropriate action.
5656

5757
You should be prepared to search for an item that matches the information given by the list view control. You should return the index of the item if successful, or -1 if no matching item is found.
5858

docs/mfc/walkthrough-adding-a-ctaskdialog-to-an-application.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This walkthrough introduces the [CTaskDialog Class](../mfc/reference/ctaskdialog
3333

3434
#### To Replace a Windows Message Box with a CTaskDialog
3535

36-
1. Create a new MFC Application project with the default settings. Call it `MyProject`.
36+
1. Create a new MFC Application project with the default settings. Call it *MyProject*.
3737

3838
2. Use the **Solution Explorer** to open the file MyProject.cpp.
3939

@@ -63,7 +63,7 @@ This walkthrough introduces the [CTaskDialog Class](../mfc/reference/ctaskdialog
6363
}
6464
```
6565

66-
6. Insert the following code between the brackets after the `if` statement from step 5. This code creates the `CTaskDialog`.
66+
6. Insert the following code between the brackets after the **if** statement from step 5. This code creates the `CTaskDialog`.
6767

6868
```
6969
CTaskDialog taskDialog(message,
@@ -100,9 +100,9 @@ This walkthrough introduces the [CTaskDialog Class](../mfc/reference/ctaskdialog
100100

101101
2. Expand the **Resource View** until you can select the **String Table** folder. Expand it and double-click the **String Table** entry.
102102

103-
3. Scroll to the bottom of the string table and add a new entry. Change the ID to `TEMP_LINE1`. Set the caption to **Command Line 1**.
103+
3. Scroll to the bottom of the string table and add a new entry. Change the ID to *TEMP_LINE1*. Set the caption to *Command Line 1*.
104104

105-
4. Add another new entry. Change the ID to `TEMP_LINE2`. Set the caption to **Command Line 2**.
105+
4. Add another new entry. Change the ID to *TEMP_LINE2*. Set the caption to *Command Line 2*.
106106

107107
5. Navigate back to MyProject.cpp.
108108

@@ -181,7 +181,7 @@ This walkthrough introduces the [CTaskDialog Class](../mfc/reference/ctaskdialog
181181

182182
2. Navigate to the closing bracket for the `if (CTaskDialog::IsSupported())` statement.
183183

184-
3. Insert the following code immediately before the closing bracket of the `if` statement (before the `else` block):
184+
3. Insert the following code immediately before the closing bracket of the **if** statement (before the **else** block):
185185

186186
```
187187
HRESULT result2 = CTaskDialog::ShowDialog(L"My error message",

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ To complete this walkthrough, you must have Visual Studio installed with the **D
3737

3838
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`. Choose **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

4242
3. In the **MFC Application Wizard**, choose **Finish** without changing any settings.
4343

@@ -121,7 +121,7 @@ To complete this walkthrough, you must have Visual Studio installed with the **D
121121

122122
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 choose **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

126126
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

0 commit comments

Comments
 (0)