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
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).
91
91
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.
93
93
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).
95
95
96
96
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.
97
97
@@ -113,7 +113,7 @@ Property pages are implemented as separate COM objects, which allow them to be s
`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.
117
117
118
118
## Adding the Property Page to the Control
119
119
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
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.
132
132
133
133
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.
Copy file name to clipboardExpand all lines: docs/atl/adding-an-event-atl-tutorial-part-5.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,23 +36,23 @@ In this step, you will add a `ClickIn` and a `ClickOut` event to your ATL contro
36
36
37
37
3. Select a **Return Type** of `void`.
38
38
39
-
4. Enter `ClickIn` in the **Method name** box.
39
+
4. Enter *ClickIn* in the **Method name** box.
40
40
41
41
5. Under **Parameter attributes**, select the **in** box.
42
42
43
43
6. Select a **Parameter type** of `LONG`.
44
44
45
-
7. Type `x` as the **Parameter name**, and click **Add**.
45
+
7. Type *x* as the **Parameter name**, and click **Add**.
46
46
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*.
48
48
49
49
9. Click **Next**.
50
50
51
51
10. Type `method ClickIn` as the **helpstring**.
52
52
53
53
11. Click **Finish**.
54
54
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.
56
56
57
57
Check the Polygon.idl file to see that the code was added to the `_IPolyCtlEvents` dispinterface.
58
58
@@ -114,7 +114,7 @@ In this step, you will add a `ClickIn` and a `ClickOut` event to your ATL contro
114
114
115
115
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`.
116
116
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.
118
118
119
119
## Building and Testing the Control
120
120
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.
Copy file name to clipboardExpand all lines: docs/atl/aggregation.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ There are times when an object's implementor would like to take advantage of the
16
16
17
17
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.
18
18
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.
20
20
21
21
## See Also
22
22
[Introduction to COM](../atl/introduction-to-com.md)
Copy file name to clipboardExpand all lines: docs/atl/atl-and-the-free-threaded-marshaler.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ ms.workload: ["cplusplus"]
14
14
# ATL and the Free Threaded Marshaler
15
15
The ATL Simple Object Wizard's Attributes page provides an option that allows your class to aggregate the free threaded marshaler (FTM).
16
16
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.
18
18
19
19
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.
Copy file name to clipboardExpand all lines: docs/atl/atl-collections-and-enumerators.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
@@ -14,9 +14,9 @@ ms.workload: ["cplusplus"]
14
14
# ATL Collections and Enumerators
15
15
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*.
16
16
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.
18
18
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`.
20
20
21
21
You can learn more about enumerator interfaces by reading about the archetypal (but entirely imaginary) [IEnumXXXX](https://msdn.microsoft.com/library/ms680089.aspx) interface.
Copy file name to clipboardExpand all lines: docs/atl/atl-copy-policy-classes.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,11 +47,11 @@ Copy policy classes are [utility classes](../atl/utility-classes.md) used to ini
47
47
-**destroy** must only ever receive a pointer to data that you have previously initialized using **init** or copied via **copy**.
48
48
49
49
## 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:
51
51
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.
53
53
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.
55
55
56
56
## Custom Implementations
57
57
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.
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.
29
29
30
30
## Calling C++ Code in the HTML File
31
31
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.
Copy file name to clipboardExpand all lines: docs/atl/catlservicemodulet-run-function.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ ms.author: "mblome"
13
13
ms.workload: ["cplusplus"]
14
14
---
15
15
# 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).
17
17
18
18
`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.
0 commit comments