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 code responds to changes made to the edit control or check box by calling [IPropertyPageImpl::SetDirty](../Topic/IPropertyPageImpl::SetDirty.md), which informs the page site that the page has changed. Typically the page site will respond by enabling or disabling an **Apply** button on the property page frame.
91
+
This code responds to changes made to the edit control or check box by calling [IPropertyPageImpl::SetDirty](../atl/reference/ipropertypageimpl-class.md#ipropertypageimpl__setdirty), which informs the page site that the page has changed. Typically the page site will respond by enabling or disabling an **Apply** button on the property page frame.
92
92
93
93
> [!NOTE]
94
94
> In your own property pages, you might need to keep track of precisely which properties have been altered by the user so that you can avoid updating properties that haven't been changed. This example implements that code by keeping track of the original property values and comparing them with the current values from the UI when it's time to apply the changes.
@@ -103,7 +103,7 @@ This example shows how to build a property page that displays (and allows you to
The first `IPropertyPageImpl` method that you need to override is [SetObjects](../Topic/IPropertyPageImpl::SetObjects.md). Here you'll add code to check that only a single object has been passed and that it supports the **Document** interface that you're expecting:
106
+
The first `IPropertyPageImpl` method that you need to override is [SetObjects](../atl/reference/ipropertypageimpl-class.md#ipropertypageimpl__setobjects). Here you'll add code to check that only a single object has been passed and that it supports the **Document** interface that you're expecting:
The base class implementation of the [Activate](../Topic/IPropertyPageImpl::Activate.md) method is responsible for creating the dialog box and its controls, so you can override this method and add your own initialization after calling the base class:
120
+
The base class implementation of the [Activate](../atl/reference/ipropertypageimpl-class.md#Activate.md) method is responsible for creating the dialog box and its controls, so you can override this method and add your own initialization after calling the base class:
This code uses the COM methods of the **Document** interface to get the properties that you're interested in. It then uses the Win32 API wrappers provided by [CDialogImpl](../atl/reference/cdialogimpl-class.md) and its base classes to display the property values to the user.
When users want to apply their changes to the objects, the property page site will call the [Apply](../Topic/IPropertyPageImpl::Apply.md) method. This is the place to do the reverse of the code in **Activate** — whereas **Activate** took values from the object and pushed them into the controls on the property page, **Apply** takes values from the controls on the property page and pushes them into the object.
127
+
When users want to apply their changes to the objects, the property page site will call the [Apply](../atl/reference/ipropertypageimpl-class.md#ipropertypageimpl__apply) method. This is the place to do the reverse of the code in **Activate** — whereas **Activate** took values from the object and pushed them into the controls on the property page, **Apply** takes values from the controls on the property page and pushes them into the object.
> The check against [m_bDirty](../Topic/IPropertyPageImpl::m_bDirty.md) at the beginning of this implementation is an initial check to avoid unnecessary updates of the objects if **Apply** is called more than once. There are also checks against each of the property values to ensure that only changes result in a method call to the **Document**.
132
+
> The check against [m_bDirty](../atl/reference/ipropertypageimpl-class.md#ipropertypageimpl__m_bDirty.md) at the beginning of this implementation is an initial check to avoid unnecessary updates of the objects if **Apply** is called more than once. There are also checks against each of the property values to ensure that only changes result in a method call to the **Document**.
133
133
134
134
> [!NOTE]
135
135
> **Document** exposes **FullName** as a read-only property. To update the file name of the document based on changes made to the property page, you have to use the **Save** method to save the file with a different name. Thus, the code in a property page doesn't have to limit itself to getting or setting properties.
Copy file name to clipboardExpand all lines: docs/atl/reference/ccommultithreadmodel-class.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ class CComMultiThreadModel
65
65
|[CComMultiThreadModel::Increment](#ccommultithreadmodel__increment)|(Static) Increments the value of the specified variable in a thread-safe manner.|
66
66
67
67
## Remarks
68
-
Typically, you use `CComMultiThreadModel` through one of two `typedef` names, either [CComObjectThreadModel](../Topic/ATL%20Typedefs.md#ccomobjectthreadmodel or [CComGlobalsThreadModel](../Topic/ATL%20Typedefs.md#ccomglobalsthreadmodel. The class referenced by each `typedef` depends on the threading model used, as shown in the following table:
68
+
Typically, you use `CComMultiThreadModel` through one of two `typedef` names, either [CComObjectThreadModel](atl-typedefs.md#ccomobjectthreadmodel or [CComGlobalsThreadModel](atl-typedefs.md#ccomglobalsthreadmodel. The class referenced by each `typedef` depends on the threading model used, as shown in the following table:
`CComMultiThreadModel` itself defines three `typedef` names. `AutoCriticalSection` and `CriticalSection` reference classes that provide methods for obtaining and releasing ownership of a critical section. `ThreadModelNoCS` references class [CComMultiThreadModelNoCS](../Topic/CComMultiThreadModelNoCS%20Class.md).
77
+
`CComMultiThreadModel` itself defines three `typedef` names. `AutoCriticalSection` and `CriticalSection` reference classes that provide methods for obtaining and releasing ownership of a critical section. `ThreadModelNoCS` references class [CComMultiThreadModelNoCS(ccommultithreadmodelnocs-class.md).
When using `CComMultiThreadModel`, the `typedef` name `AutoCriticalSection` references class [CComAutoCriticalSection](../Topic/CComAutoCriticalSection%20Class.md), which provides methods for obtaining and releasing ownership of a critical section object.
83
+
When using `CComMultiThreadModel`, the `typedef` name `AutoCriticalSection` references class [CComAutoCriticalSection](iccomautocriticalsection-class.md), which provides methods for obtaining and releasing ownership of a critical section object.
[CComSingleThreadModel](../Topic/CComSingleThreadModel%20Class.md) and [CComMultiThreadModelNoCS](../Topic/CComMultiThreadModelNoCS%20Class.md) also contain definitions for `AutoCriticalSection`. The following table shows the relationship between the threading model class and the critical section class referenced by `AutoCriticalSection`:
90
+
[CComSingleThreadModel](ccomsinglethreadmodel-class.md) and [CComMultiThreadModelNoCS](ccommultithreadmodelnocs-class.md) also contain definitions for `AutoCriticalSection`. The following table shows the relationship between the threading model class and the critical section class referenced by `AutoCriticalSection`:
In addition to `AutoCriticalSection`, you can use the `typedef` name [CriticalSection](#ccommultithreadmodel__criticalsection). You should not specify `AutoCriticalSection` in global objects or static class members if you want to eliminate the CRT startup code.
99
99
100
100
### Example
101
-
The following code is modeled after [CComObjectRootEx](../Topic/CComObjectRootEx%20Class.md), and demonstrates `AutoCriticalSection` being used in a threading environment.
101
+
The following code is modeled after [CComObjectRootEx](ccomobjectrootex-class.md), and demonstrates `AutoCriticalSection` being used in a threading environment.
When using `CComMultiThreadModel`, the `typedef` name `CriticalSection` references class [CComCriticalSection](../Topic/CComCriticalSection%20Class.md), which provides methods for obtaining and releasing ownership of a critical section object.
122
+
When using `CComMultiThreadModel`, the `typedef` name `CriticalSection` references class [CComCriticalSection](ccomcriticalsection-class.md), which provides methods for obtaining and releasing ownership of a critical section object.
123
123
124
124
```
125
125
typedef CComCriticalSection CriticalSection;
126
126
```
127
127
128
128
### Remarks
129
-
[CComSingleThreadModel](../Topic/CComSingleThreadModel%20Class.md) and [CComMultiThreadModelNoCS](../Topic/CComMultiThreadModelNoCS%20Class.md) also contain definitions for `CriticalSection`. The following table shows the relationship between the threading model class and the critical section class referenced by `CriticalSection`:
129
+
[CComSingleThreadModel](ccomsinglethreadmodel-class.md) and [CComMultiThreadModelNoCS](ccommultithreadmodelnocs-class.md) also contain definitions for `CriticalSection`. The following table shows the relationship between the threading model class and the critical section class referenced by `CriticalSection`:
When using `CComMultiThreadModel`, the `typedef` name `ThreadModelNoCS` references class [CComMultiThreadModelNoCS](../Topic/CComMultiThreadModelNoCS%20Class.md).
177
+
When using `CComMultiThreadModel`, the `typedef` name `ThreadModelNoCS` references class [CComMultiThreadModelNoCS](ccommultithreadmodelnocs-class.md).
`CComMultiThreadModelNoCS` provides thread-safe methods for incrementing and decrementing a variable; however, it does not provide a critical section.
185
185
186
-
[CComSingleThreadModel](../Topic/CComSingleThreadModel%20Class.md) and `CComMultiThreadModelNoCS` also contain definitions for `ThreadModelNoCS`. The following table shows the relationship between the threading model class and the class referenced by `ThreadModelNoCS`:
186
+
[CComSingleThreadModel](ccomsinglethreadmodel-class.md) and `CComMultiThreadModelNoCS` also contain definitions for `ThreadModelNoCS`. The following table shows the relationship between the threading model class and the class referenced by `ThreadModelNoCS`:
Copy file name to clipboardExpand all lines: docs/atl/threading-models-and-critical-sections-classes.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
@@ -50,9 +50,9 @@ The following classes define a threading model and critical section:
50
50
51
51
-[CComSingleThreadModel](../atl/reference/ccomsinglethreadmodel-class.md) Provides methods for incrementing and decrementing a variable. Does not provide a critical section.
52
52
53
-
-[CComObjectThreadModel](../Topic/CComObjectThreadModel.md) Determines the appropriate threading-model class for a single object class.
53
+
-[CComObjectThreadModel](../atl/reference/atl-typedefs.md#ccomobjectthreadmodel) Determines the appropriate threading-model class for a single object class.
54
54
55
-
-[CComGlobalsThreadModel](../Topic/CComGlobalsThreadModel.md) Determines the appropriate threading-model class for an object that is globally available.
55
+
-[CComGlobalsThreadModel](../atl/reference/atl-typedefs.md#ccomglobalsthreadmodel) Determines the appropriate threading-model class for an object that is globally available.
56
56
57
57
-[CComAutoCriticalSection](../atl/reference/ccomautocriticalsection-class.md) Contains methods for obtaining and releasing a critical section. The critical section is automatically initialized.
Copy file name to clipboardExpand all lines: docs/atl/using-replaceable-parameters-the-registrar-s-preprocessor.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
@@ -59,7 +59,7 @@ Replaceable parameters allow a Registrar's client to specify run-time data. To d
59
59
> In a Registrar script, 4K is the maximum token size. (A token is any recognizable element in the syntax.) This includes tokens that were created or expanded by the preprocessor.
60
60
61
61
> [!NOTE]
62
-
> To substitute replacement values at run time, remove the call in the script to the [DECLARE_REGISTRY_RESOURCE](http://msdn.microsoft.com/Library/7ac11498-8ee2-4156-8df2-7076f7ddda8b) or [DECLARE_REGISTRY_RESOURCEID](http://msdn.microsoft.com/Library/65bf3576-5396-416e-ba48-e14b3236c49b) macro. Instead, replace it with your own `UpdateRegistry` method that calls [CAtlModule::UpdateRegistryFromResourceD](../Topic/CAtlModule::UpdateRegistryFromResourceD.md) or [CAtlModule::UpdateRegistryFromResourceS](../Topic/CAtlModule::UpdateRegistryFromResourceS.md), and pass your array of **_ATL_REGMAP_ENTRY** structures. Your array of **_ATL_REGMAP_ENTRY** must have at least one entry that is set to {**NULL**,**NULL**}, and this entry should always be the last entry. Otherwise, an access violation error will be generated when **UpdateRegistryFromResource** is called.
62
+
> To substitute replacement values at run time, remove the call in the script to the [DECLARE_REGISTRY_RESOURCE](../atl/reference/registry-macros.md#declare_registry_resource) or [DECLARE_REGISTRY_RESOURCEID](../atl/reference/registry-macros.md#declare_registry_resourceid) macro. Instead, replace it with your own `UpdateRegistry` method that calls [CAtlModule::UpdateRegistryFromResourceD](../atl/reference/catlmodule.catlmodulemd#catlmodule__updateregistryfromresourced) or [CAtlModule::UpdateRegistryFromResourceS](../atl/reference/catlmodule.catlmodulemd#catlmodule__updateregistryfromresources), and pass your array of **_ATL_REGMAP_ENTRY** structures. Your array of **_ATL_REGMAP_ENTRY** must have at least one entry that is set to {**NULL**,**NULL**}, and this entry should always be the last entry. Otherwise, an access violation error will be generated when **UpdateRegistryFromResource** is called.
63
63
64
64
> [!NOTE]
65
65
> When building a project that outputs an executable, ATL automatically adds quotation marks around the path name created at run time with the **%MODULE%** registrar script parameter. If you do not want the path name to include the quotation marks, use the new **%MODULE_RAW%** parameter instead.
0 commit comments