Skip to content

Commit 9e02709

Browse files
author
mtx48109
committed
format atl pr1
1 parent b159399 commit 9e02709

30 files changed

+131
-131
lines changed

docs/atl/adding-a-property-page-atl-tutorial-part-6.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Property pages are implemented as separate COM objects, which allow them to be s
3030

3131
3. From the list of templates, select **ATL Property Page** and click **Add**.
3232

33-
4. When the ATL Property Page Wizard appears, enter `PolyProp` as the **Short** name.
33+
4. When the ATL Property Page Wizard appears, enter *PolyProp* as the **Short** name.
3434

3535
5. Click **Strings** to open the **Strings** page and enter **&Polygon** as the **Title**.
3636

@@ -87,11 +87,11 @@ Property pages are implemented as separate COM objects, which allow them to be s
8787

8888
[!code-cpp[NVC_ATL_Windowing#58](../atl/codesnippet/cpp/adding-a-property-page-atl-tutorial-part-6_1.h)]
8989

90-
A property page can have more than one client attached to it at a time, so the `Apply` function loops around and calls `put_Sides` on each client with the value retrieved from the edit box. You are using the [CComQIPtr](../atl/reference/ccomqiptr-class.md) class, which performs the `QueryInterface` on each object to obtain the `IPolyCtl` interface from the **IUnknown** interface (stored in the `m_ppUnk` array).
90+
A property page can have more than one client attached to it at a time, so the `Apply` function loops around and calls `put_Sides` on each client with the value retrieved from the edit box. You are using the [CComQIPtr](../atl/reference/ccomqiptr-class.md) class, which performs the `QueryInterface` on each object to obtain the `IPolyCtl` interface from the `IUnknown` interface (stored in the `m_ppUnk` array).
9191

92-
The code now checks that setting the `Sides` property actually worked. If it fails, the code displays a message box displaying error details from the **IErrorInfo** interface. Typically, a container asks an object for the **ISupportErrorInfo** interface and calls `InterfaceSupportsErrorInfo` first, to determine whether the object supports setting error information. You can skip this task.
92+
The code now checks that setting the `Sides` property actually worked. If it fails, the code displays a message box displaying error details from the `IErrorInfo` interface. Typically, a container asks an object for the `ISupportErrorInfo` interface and calls `InterfaceSupportsErrorInfo` first, to determine whether the object supports setting error information. You can skip this task.
9393

94-
[CComPtr](../atl/reference/ccomptr-class.md) helps you by automatically handling the reference counting, so you do not need to call `Release` on the interface. `CComBSTR` helps you with `BSTR` processing, so you do not have to perform the final `SysFreeString` call. You also use one of the various string conversion classes, so you can convert the `BSTR` if necessary (this is why the `USES_CONVERSION` macro is at the start of the function).
94+
[CComPtr](../atl/reference/ccomptr-class.md) helps you by automatically handling the reference counting, so you do not need to call `Release` on the interface. `CComBSTR` helps you with BSTR processing, so you do not have to perform the final `SysFreeString` call. You also use one of the various string conversion classes, so you can convert the BSTR if necessary (this is why the USES_CONVERSION macro is at the start of the function).
9595

9696
You also need to set the property page's dirty flag to indicate that the **Apply** button should be enabled. This occurs when the user changes the value in the **Sides** edit box.
9797

@@ -113,7 +113,7 @@ Property pages are implemented as separate COM objects, which allow them to be s
113113

114114
[!code-cpp[NVC_ATL_Windowing#59](../atl/codesnippet/cpp/adding-a-property-page-atl-tutorial-part-6_2.cpp)]
115115

116-
`OnEnChangeSides` will be called when a **WM_COMMAND** message is sent with the **EN_CHANGE** notification for the `IDC_SIDES` control. `OnEnChangeSides` then calls `SetDirty` and passes `TRUE` to indicate the property page is now dirty and the **Apply** button should be enabled.
116+
`OnEnChangeSides` will be called when a WM_COMMAND message is sent with the EN_CHANGE notification for the `IDC_SIDES` control. `OnEnChangeSides` then calls `SetDirty` and passes TRUE to indicate the property page is now dirty and the **Apply** button should be enabled.
117117

118118
## Adding the Property Page to the Control
119119
The ATL Add Class Wizard and the ATL Property Page Wizard do not add the property page to your control for you automatically, because there could be multiple controls in your project. You will need to add an entry to the control's property map.
@@ -128,7 +128,7 @@ Property pages are implemented as separate COM objects, which allow them to be s
128128

129129
[!code-cpp[NVC_ATL_Windowing#61](../atl/codesnippet/cpp/adding-a-property-page-atl-tutorial-part-6_4.h)]
130130

131-
You could have added a `PROP_PAGE` macro with the CLSID of your property page, but if you use the `PROP_ENTRY` macro as shown, the `Sides` property value is also saved when the control is saved.
131+
You could have added a PROP_PAGE macro with the CLSID of your property page, but if you use the PROP_ENTRY macro as shown, the `Sides` property value is also saved when the control is saved.
132132

133133
The three parameters to the macro are the property description, the DISPID of the property, and the CLSID of the property page that has the property on it. This is useful if, for example, you load the control into Visual Basic and set the number of Sides at design time. Because the number of Sides is saved, when you reload your Visual Basic project, the number of Sides will be restored.
134134

docs/atl/adding-a-property-to-the-control-atl-tutorial-part-3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ms.workload: ["cplusplus"]
2525

2626
4. In the drop-down list of property types, select `SHORT`.
2727

28-
5. Type `Sides` as the **Property name.**
28+
5. Type *Sides* as the **Property name.**
2929

3030
6. Click **Finish** to finish adding the property.
3131

docs/atl/adding-an-event-atl-tutorial-part-5.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,23 @@ In this step, you will add a `ClickIn` and a `ClickOut` event to your ATL contro
3636

3737
3. Select a **Return Type** of `void`.
3838

39-
4. Enter `ClickIn` in the **Method name** box.
39+
4. Enter *ClickIn* in the **Method name** box.
4040

4141
5. Under **Parameter attributes**, select the **in** box.
4242

4343
6. Select a **Parameter type** of `LONG`.
4444

45-
7. Type `x` as the **Parameter name**, and click **Add**.
45+
7. Type *x* as the **Parameter name**, and click **Add**.
4646

47-
8. Repeat steps 5 through 7, this time for a **Parameter name** of `y`.
47+
8. Repeat steps 5 through 7, this time for a **Parameter name** of *y*.
4848

4949
9. Click **Next**.
5050

5151
10. Type `method ClickIn` as the **helpstring**.
5252

5353
11. Click **Finish**.
5454

55-
12. Repeat the steps above to define a `ClickOut` method with the same `LONG` parameters `x` and `y`, the same **Parameter attributes** and the same `void` return type.
55+
12. Repeat the steps above to define a `ClickOut` method with the same `LONG` parameters *x* and *y*, the same **Parameter attributes** and the same `void` return type.
5656

5757
Check the Polygon.idl file to see that the code was added to the `_IPolyCtlEvents` dispinterface.
5858

@@ -114,7 +114,7 @@ In this step, you will add a `ClickIn` and a `ClickOut` event to your ATL contro
114114

115115
This code makes use of the points calculated in the `OnDraw` function to create a region that detects the user's mouse clicks with the call to `PtInRegion`.
116116

117-
The `uMsg` parameter is the ID of the Windows message being handled. This allows you to have one function that handles a range of messages. The `wParam` and the `lParam` parameters are the standard values for the message being handled. The parameter bHandled allows you to specify whether the function handled the message or not. By default, the value is set to `TRUE` to indicate that the function handled the message, but you can set it to `FALSE`. This will cause ATL to continue looking for another message handler function to send the message to.
117+
The *uMsg* parameter is the ID of the Windows message being handled. This allows you to have one function that handles a range of messages. The *wParam* and the *lParam* parameters are the standard values for the message being handled. The parameter bHandled allows you to specify whether the function handled the message or not. By default, the value is set to TRUE to indicate that the function handled the message, but you can set it to FALSE. This will cause ATL to continue looking for another message handler function to send the message to.
118118

119119
## Building and Testing the Control
120120
Now try out your events. Build the control and start the ActiveX Control Test Container again. This time, view the event log window. To route events to the output window, click **Logging** from the **Options** menu and select **Log to output window**. Insert the control and try clicking in the window. Note that `ClickIn` is fired if you click within the filled polygon, and `ClickOut` is fired when you click outside of it.

docs/atl/aggregation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ There are times when an object's implementor would like to take advantage of the
1616

1717
Aggregation means that the containing (outer) object creates the contained (inner) object as part of its creation process and the interfaces of the inner object are exposed by the outer. An object allows itself to be aggregatable or not. If it is, then it must follow certain rules for aggregation to work properly.
1818

19-
Primarily, all **IUnknown** method calls on the contained object must delegate to the containing object.
19+
Primarily, all `IUnknown` method calls on the contained object must delegate to the containing object.
2020

2121
## See Also
2222
[Introduction to COM](../atl/introduction-to-com.md)

docs/atl/atl-and-the-free-threaded-marshaler.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.workload: ["cplusplus"]
1414
# ATL and the Free Threaded Marshaler
1515
The ATL Simple Object Wizard's Attributes page provides an option that allows your class to aggregate the free threaded marshaler (FTM).
1616

17-
The wizard generates code to create an instance of the free threaded marshaler in `FinalConstruct` and release that instance in `FinalRelease`. A `COM_INTERFACE_ENTRY_AGGREGATE` macro is automatically added to the COM map to ensure that `QueryInterface` requests for [IMarshal](http://msdn.microsoft.com/library/windows/desktop/dd542707) are handled by the free threaded marshaler.
17+
The wizard generates code to create an instance of the free threaded marshaler in `FinalConstruct` and release that instance in `FinalRelease`. A COM_INTERFACE_ENTRY_AGGREGATE macro is automatically added to the COM map to ensure that `QueryInterface` requests for [IMarshal](http://msdn.microsoft.com/library/windows/desktop/dd542707) are handled by the free threaded marshaler.
1818

1919
The free threaded marshaler allows direct access to interfaces on your object from any thread in the same process, speeding up cross-apartment calls. This option is intended for classes that use the Both threading model.
2020

docs/atl/atl-collections-and-enumerators.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ ms.workload: ["cplusplus"]
1414
# ATL Collections and Enumerators
1515
A `collection` is a COM object that provides an interface that allows access to a group of data items (raw data or other objects). An interface that follows the standards for providing access to a group of objects is known as a *collection interface*.
1616

17-
At a minimum, collection interfaces must provide a **Count** property that returns the number of items in the collection, an **Item** property that returns an item from the collection based on an index, and a `_NewEnum` property that returns an enumerator for the collection. Optionally, collection interfaces can provide **Add** and **Remove** methods to allow items to be inserted into or deleted from the collection, and a **Clear** method to remove all items.
17+
At a minimum, collection interfaces must provide a `Count` property that returns the number of items in the collection, an `Item` property that returns an item from the collection based on an index, and a `_NewEnum` property that returns an enumerator for the collection. Optionally, collection interfaces can provide `Add` and `Remove` methods to allow items to be inserted into or deleted from the collection, and a `Clear` method to remove all items.
1818

19-
An `enumerator` is a COM object that provides an interface for iterating through items in a collection. Enumerator interfaces provide serial access to the elements of a collection via four required methods: `Next`, **Skip**, **Reset**, and `Clone`.
19+
An `enumerator` is a COM object that provides an interface for iterating through items in a collection. Enumerator interfaces provide serial access to the elements of a collection via four required methods: `Next`, `Skip`, `Reset`, and `Clone`.
2020

2121
You can learn more about enumerator interfaces by reading about the archetypal (but entirely imaginary) [IEnumXXXX](https://msdn.microsoft.com/library/ms680089.aspx) interface.
2222

docs/atl/atl-copy-policy-classes.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ Copy policy classes are [utility classes](../atl/utility-classes.md) used to ini
4747
- **destroy** must only ever receive a pointer to data that you have previously initialized using **init** or copied via **copy**.
4848

4949
## Standard Implementations
50-
ATL provides two copy policy classes in the form of the **_Copy** and **_CopyInterface** template classes:
50+
ATL provides two copy policy classes in the form of the `_Copy` and `_CopyInterface` template classes:
5151

52-
- The **_Copy** class allows homogeneous copying only (not conversion between data types) since it only offers a single template parameter to specify both `DestinationType` and *SourceType*. The generic implementation of this template contains no initialization or destruction code and uses `memcpy` to copy the data. ATL also provides specializations of **_Copy** for **VARIANT**, `LPOLESTR`, **OLEVERB**, and **CONNECTDATA** data types.
52+
- The `_Copy` class allows homogeneous copying only (not conversion between data types) since it only offers a single template parameter to specify both `DestinationType` and *SourceType*. The generic implementation of this template contains no initialization or destruction code and uses `memcpy` to copy the data. ATL also provides specializations of `_Copy` for VARIANT, LPOLESTR, OLEVERB, and CONNECTDATA data types.
5353

54-
- The **_CopyInterface** class provides an implementation for copying interface pointers following standard COM rules. Once again this class allows only homogeneous copying, so it uses simple assignment and a call to `AddRef` to perform the copy.
54+
- The `_CopyInterface` class provides an implementation for copying interface pointers following standard COM rules. Once again this class allows only homogeneous copying, so it uses simple assignment and a call to `AddRef` to perform the copy.
5555

5656
## Custom Implementations
5757
Typically, you'll need to define your own copy policy classes for heterogeneous copying (that is, conversion between data types). For some examples of custom copy policy classes, look at the files VCUE_Copy.h and VCUE_CopyString.h in the [ATLCollections](../visual-cpp-samples.md) sample. These files contain two template copy policy classes, `GenericCopy` and `MapCopy`, plus a number of specializations of `GenericCopy` for different data types.

docs/atl/atl-event-handling-summary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ In general, handling COM events is a relatively simple process. There are three
3030
|[IDispEventImpl](../atl/reference/idispeventimpl-class.md)|Dispinterface|No|Yes|
3131
|[IDispEventSimpleImpl](../atl/reference/idispeventsimpleimpl-class.md)|Dispinterface|No|No|
3232

33-
\* When using ATL support classes, you are never required to implement the **IUnknown** or `IDispatch` methods manually.
33+
\* When using ATL support classes, you are never required to implement the `IUnknown` or `IDispatch` methods manually.
3434

3535
## Advising and Unadvising the Event Source
3636
There are three main ways of advising and unadvising an event source using ATL.

docs/atl/calling-cpp-code-from-dhtml.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ A DHTML control can be hosted in a container, such as Test Container or Internet
2525

2626
[!code-cpp[NVC_ATL_COM#4](../atl/codesnippet/cpp/calling-cpp-code-from-dhtml_1.h)]
2727

28-
The first parameter, `pdispBody`, is a pointer to the body object's dispatch interface. The second parameter, `varColor`, identifies the color to apply to the control.
28+
The first parameter, *pdispBody*, is a pointer to the body object's dispatch interface. The second parameter, *varColor*, identifies the color to apply to the control.
2929

3030
## Calling C++ Code in the HTML File
3131
Once you have declared the WebBrowser methods in the header file, you can invoke the methods from the HTML file. Notice in the HTML file that the ATL Control Wizard inserts three Windows dispatch methods: three `OnClick` methods that dispatch messages to change the background color of the control.

docs/atl/catlservicemodulet-run-function.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ms.author: "mblome"
1313
ms.workload: ["cplusplus"]
1414
---
1515
# CAtlServiceModuleT::Run Function
16-
**Run** contains calls to `PreMessageLoop`, `RunMessageLoop`, and `PostMessageLoop`. After being called, `PreMessageLoop` first stores the service's thread ID. The service will use this ID to close itself by sending a **WM_QUIT** message using the Win32 API function, [PostThreadMessage](http://msdn.microsoft.com/library/windows/desktop/ms644946).
16+
`Run` contains calls to `PreMessageLoop`, `RunMessageLoop`, and `PostMessageLoop`. After being called, `PreMessageLoop` first stores the service's thread ID. The service will use this ID to close itself by sending a WM_QUIT message using the Win32 API function, [PostThreadMessage](http://msdn.microsoft.com/library/windows/desktop/ms644946).
1717

1818
`PreMessageLoop` then calls `InitializeSecurity`. By default, `InitializeSecurity` calls [CoInitializeSecurity](http://msdn.microsoft.com/library/windows/desktop/ms693736) with the security descriptor set to NULL, which means that any user has access to your object.
1919

0 commit comments

Comments
 (0)