Skip to content

Commit a43420f

Browse files
author
mtx48109
committed
format atl pr2
1 parent b159399 commit a43420f

28 files changed

+209
-209
lines changed

docs/atl/implementing-ccomobject-ccomaggobject-and-ccompolyobject.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ ms.author: "mblome"
1313
ms.workload: ["cplusplus"]
1414
---
1515
# Implementing CComObject, CComAggObject, and CComPolyObject
16-
The template classes [CComObject](../atl/reference/ccomobject-class.md), [CComAggObject](../atl/reference/ccomaggobject-class.md), and [CComPolyObject](../atl/reference/ccompolyobject-class.md) are always the most derived classes in the inheritance chain. It is their responsibility to handle all of the methods in **IUnknown**: `QueryInterface`, `AddRef`, and **Release**. In addition, `CComAggObject` and `CComPolyObject` (when used for aggregated objects) provide the special reference counting and `QueryInterface` semantics required for the inner unknown.
16+
The template classes [CComObject](../atl/reference/ccomobject-class.md), [CComAggObject](../atl/reference/ccomaggobject-class.md), and [CComPolyObject](../atl/reference/ccompolyobject-class.md) are always the most derived classes in the inheritance chain. It is their responsibility to handle all of the methods in `IUnknown`: `QueryInterface`, `AddRef`, and `Release`. In addition, `CComAggObject` and `CComPolyObject` (when used for aggregated objects) provide the special reference counting and `QueryInterface` semantics required for the inner unknown.
1717

1818
Whether `CComObject`, `CComAggObject`, or `CComPolyObject` is used depends on whether you declare one (or none) of the following macros:
1919

2020
|Macro|Effect|
2121
|-----------|------------|
22-
|`DECLARE_NOT_AGGREGATABLE`|Always uses `CComObject`.|
23-
|`DECLARE_AGGREGATABLE`|Uses `CComAggObject` if the object is aggregated and `CComObject` if it is not. `CComCoClass` contains this macro so if none of the **DECLARE_\*_AGGREGATABLE** macros are declared in your class, this will be the default.|
24-
|`DECLARE_ONLY_AGGREGATABLE`|Always uses `CComAggObject`. Returns an error if the object is not aggregated.|
25-
|`DECLARE_POLY_AGGREGATABLE`|ATL creates an instance of **CComPolyObject\<CYourClass>** when **IClassFactory::CreateInstance** is called. During creation, the value of the outer unknown is checked. If it is **NULL**, **IUnknown** is implemented for a nonaggregated object. If the outer unknown is not **NULL**, **IUnknown** is implemented for an aggregated object.|
22+
|DECLARE_NOT_AGGREGATABLE|Always uses `CComObject`.|
23+
|DECLARE_AGGREGATABLE|Uses `CComAggObject` if the object is aggregated and `CComObject` if it is not. `CComCoClass` contains this macro so if none of the DECLARE_*_AGGREGATABLE macros are declared in your class, this will be the default.|
24+
|DECLARE_ONLY_AGGREGATABLE|Always uses `CComAggObject`. Returns an error if the object is not aggregated.|
25+
|DECLARE_POLY_AGGREGATABLE|ATL creates an instance of **CComPolyObject\<CYourClass>** when `IClassFactory::CreateInstance` is called. During creation, the value of the outer unknown is checked. If it is NULL, `IUnknown` is implemented for a nonaggregated object. If the outer unknown is not NULL, `IUnknown` is implemented for an aggregated object.|
2626

27-
The advantage of using `CComAggObject` and `CComObject` is that the implementation of **IUnknown** is optimized for the kind of object being created. For instance, a nonaggregated object only needs a reference count, while an aggregated object needs both a reference count for the inner unknown and a pointer to the outer unknown.
27+
The advantage of using `CComAggObject` and `CComObject` is that the implementation of `IUnknown` is optimized for the kind of object being created. For instance, a nonaggregated object only needs a reference count, while an aggregated object needs both a reference count for the inner unknown and a pointer to the outer unknown.
2828

2929
The advantage of using `CComPolyObject` is that you avoid having both `CComAggObject` and `CComObject` in your module to handle the aggregated and nonaggregated cases. A single `CComPolyObject` object handles both cases. This means only one copy of the vtable and one copy of the functions exist in your module. If your vtable is large, this can substantially decrease your module size. However, if your vtable is small, using `CComPolyObject` can result in a slightly larger module size because it is not optimized for an aggregated or nonaggregated object, as are `CComAggObject` and `CComObject`.
3030

docs/atl/implementing-property-pages.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
# Implementing Property Pages
15-
Property pages are COM objects that implement the `IPropertyPage` or **IPropertyPage2** interface. ATL provides support for implementing property pages through the [ATL Property Page Wizard](../atl/reference/atl-property-page-wizard.md) in the [Add Class dialog box](../ide/add-class-dialog-box.md).
15+
Property pages are COM objects that implement the `IPropertyPage` or `IPropertyPage2` interface. ATL provides support for implementing property pages through the [ATL Property Page Wizard](../atl/reference/atl-property-page-wizard.md) in the [Add Class dialog box](../ide/add-class-dialog-box.md).
1616

1717
To create a property page using ATL:
1818

docs/atl/interfaces-atl.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
---
2-
title: "Interfaces (ATL) | Microsoft Docs"
3-
ms.custom: ""
4-
ms.date: "11/04/2016"
5-
ms.technology: ["cpp-atl"]
6-
ms.topic: "reference"
7-
dev_langs: ["C++"]
8-
helpviewer_keywords: ["COM interfaces", "interfaces, COM"]
9-
ms.assetid: de6c8b12-6230-4fdc-af66-a28b91d5ee55
10-
author: "mikeblome"
11-
ms.author: "mblome"
12-
ms.workload: ["cplusplus"]
1+
---
2+
title: "Interfaces (ATL) | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "11/04/2016"
5+
ms.technology: ["cpp-atl"]
6+
ms.topic: "reference"
7+
dev_langs: ["C++"]
8+
helpviewer_keywords: ["COM interfaces", "interfaces, COM"]
9+
ms.assetid: de6c8b12-6230-4fdc-af66-a28b91d5ee55
10+
author: "mikeblome"
11+
ms.author: "mblome"
12+
ms.workload: ["cplusplus"]
1313
---
1414
# Interfaces (ATL)
1515
An interface is the way in which an object exposes its functionality to the outside world. In COM, an interface is a table of pointers (like a C++ vtable) to functions implemented by the object. The table represents the interface, and the functions to which it points are the methods of that interface. An object can expose as many interfaces as it chooses.
1616

17-
Each interface is based on the fundamental COM interface, [IUnknown](../atl/iunknown.md). The methods of **IUnknown** allow navigation to other interfaces exposed by the object.
17+
Each interface is based on the fundamental COM interface, [IUnknown](../atl/iunknown.md). The methods of `IUnknown` allow navigation to other interfaces exposed by the object.
1818

1919
Also, each interface is given a unique interface ID (IID). This uniqueness makes it easy to support interface versioning. A new version of an interface is simply a new interface, with a new IID.
2020

docs/atl/introduction-to-com-and-atl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This section provides a brief introduction to COM and ATL.
1616

1717
## In This Section
1818
[Introduction to COM](../atl/introduction-to-com.md)
19-
Provides an overview of the Component Object Model's (COM) fundamental concepts, including interfaces, **IUnknown**, reference counting, `QueryInterface`, marshaling, and aggregation.
19+
Provides an overview of the Component Object Model's (COM) fundamental concepts, including interfaces, `IUnknown`, reference counting, `QueryInterface`, marshaling, and aggregation.
2020

2121
[Introduction to ATL](../atl/introduction-to-atl.md)
2222
Discusses, briefly, what the Active Template Library (ATL) was designed for, template libraries, and ATL version numbers. Includes recommendations for choosing between ATL and MFC.

docs/atl/invoking-scripts.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ ms.workload: ["cplusplus"]
1717

1818
|Method|Syntax/Description|
1919
|------------|-------------------------|
20-
|**ResourceRegister**|**HRESULT ResourceRegister( LPCOLESTR** *resFileName* **, UINT** `nID` **, LPCOLESTR** `szType` **);**<br /><br /> Registers the script contained in a module's resource. *resFileName* indicates the UNC path to the module itself. `nID` and `szType` contain the resource's ID and type, respectively.|
21-
|**ResourceUnregister**|**HRESULT ResourceUnregister( LPCOLESTR** *resFileName* **, UINT** `nID` **, LPCOLESTR** `szType` **);**<br /><br /> Unregisters the script contained in a module's resource. *resFileName* indicates the UNC path to the module itself. `nID` and `szType` contain the resource's ID and type, respectively.|
22-
|**ResourceRegisterSz**|**HRESULT ResourceRegisterSz( LPCOLESTR** *resFileName* **, LPCOLESTR** *szID* **, LPCOLESTR** `szType` **);**<br /><br /> Registers the script contained in a module's resource. *resFileName* indicates the UNC path to the module itself. *szID* and `szType` contain the resource's string identifier and type, respectively.|
23-
|**ResourceUnregisterSz**|**HRESULT ResourceUnregisterSz( LPCOLESTR** *resFileName* **, LPCOLESTR** *szID* **, LPCOLESTR** `szType` **);**<br /><br /> Unregisters the script contained in a module's resource. *resFileName* indicates the UNC path to the module itself. *szID* and `szType` contain the resource's string identifier and type, respectively.|
20+
|**ResourceRegister**|**HRESULT ResourceRegister( LPCOLESTR** *resFileName* **, UINT** `nID` **, LPCOLESTR** `szType` **);**<br /><br /> Registers the script contained in a module's resource. *resFileName* indicates the UNC path to the module itself. *nID* and *szType* contain the resource's ID and type, respectively.|
21+
|**ResourceUnregister**|**HRESULT ResourceUnregister( LPCOLESTR** *resFileName* **, UINT** `nID` **, LPCOLESTR** `szType` **);**<br /><br /> Unregisters the script contained in a module's resource. *resFileName* indicates the UNC path to the module itself. *nID* and *szType* contain the resource's ID and type, respectively.|
22+
|**ResourceRegisterSz**|**HRESULT ResourceRegisterSz( LPCOLESTR** *resFileName* **, LPCOLESTR** *szID* **, LPCOLESTR** `szType` **);**<br /><br /> Registers the script contained in a module's resource. *resFileName* indicates the UNC path to the module itself. *szID* and *szType* contain the resource's string identifier and type, respectively.|
23+
|**ResourceUnregisterSz**|**HRESULT ResourceUnregisterSz( LPCOLESTR** *resFileName* **, LPCOLESTR** *szID* **, LPCOLESTR** `szType` **);**<br /><br /> Unregisters the script contained in a module's resource. *resFileName* indicates the UNC path to the module itself. *szID* and *szType* contain the resource's string identifier and type, respectively.|
2424
|**FileRegister**|**HRESULT FileRegister( LPCOLESTR** *fileName* **);**<br /><br /> Registers the script in a file. *fileName* is a UNC path to a file that contains (or is) a resource script.|
2525
|**FileUnregister**|**HRESULT FileUnregister( LPCOLESTR** *fileName* **);**<br /><br /> Unregisters the script in a file. *fileName* is a UNC path to a file that contains (or is) a resource script.|
2626
|**StringRegister**|**HRESULT StringRegister( LPCOLESTR** *data* **);**<br /><br /> Registers the script in a string. *data* contains the script itself.|

docs/atl/iunknown-implementation-classes.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
---
2-
title: "IUnknown Implementation Classes (ATL) | Microsoft Docs"
3-
ms.custom: ""
4-
ms.date: "11/04/2016"
5-
ms.technology: ["cpp-atl"]
6-
ms.topic: "reference"
7-
f1_keywords: ["vc.atl.Iunknown"]
8-
dev_langs: ["C++"]
9-
helpviewer_keywords: ["IUnknown implementation classes"]
10-
ms.assetid: 47b69bb5-69d8-4a9c-84a8-329bdde2bb3f
11-
author: "mikeblome"
12-
ms.author: "mblome"
13-
ms.workload: ["cplusplus"]
1+
---
2+
title: "IUnknown Implementation Classes (ATL) | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "11/04/2016"
5+
ms.technology: ["cpp-atl"]
6+
ms.topic: "reference"
7+
f1_keywords: ["vc.atl.Iunknown"]
8+
dev_langs: ["C++"]
9+
helpviewer_keywords: ["IUnknown implementation classes"]
10+
ms.assetid: 47b69bb5-69d8-4a9c-84a8-329bdde2bb3f
11+
author: "mikeblome"
12+
ms.author: "mblome"
13+
ms.workload: ["cplusplus"]
1414
---
1515
# IUnknown Implementation Classes
16-
The following classes implement **IUnknown** and related methods:
16+
The following classes implement `IUnknown` and related methods:
1717

1818
- [CComObjectRootEx](../atl/reference/ccomobjectrootex-class.md) Manages reference counting for both aggregated and nonaggregated objects. Allows you to specify a threading model.
1919

2020
- [CComObjectRoot](../atl/reference/ccomobjectroot-class.md) Manages reference counting for both aggregated and nonaggregated objects. Uses the default threading model of the server.
2121

22-
- [CComAggObject](../atl/reference/ccomaggobject-class.md) Implements **IUnknown** for an aggregated object.
22+
- [CComAggObject](../atl/reference/ccomaggobject-class.md) Implements `IUnknown` for an aggregated object.
2323

24-
- [CComObject](../atl/reference/ccomobject-class.md) Implements **IUnknown** for a nonaggregated object.
24+
- [CComObject](../atl/reference/ccomobject-class.md) Implements `IUnknown` for a nonaggregated object.
2525

26-
- [CComPolyObject](../atl/reference/ccompolyobject-class.md) Implements **IUnknown** for aggregated and nonaggregated objects. Using `CComPolyObject` avoids having both `CComAggObject` and `CComObject` in your module. A single `CComPolyObject` object handles both aggregated and nonaggregated cases.
26+
- [CComPolyObject](../atl/reference/ccompolyobject-class.md) Implements `IUnknown` for aggregated and nonaggregated objects. Using `CComPolyObject` avoids having both `CComAggObject` and `CComObject` in your module. A single `CComPolyObject` object handles both aggregated and nonaggregated cases.
2727

28-
- [CComObjectNoLock](../atl/reference/ccomobjectnolock-class.md) Implements **IUnknown** for a nonaggregated object, without modifying the module lock count.
28+
- [CComObjectNoLock](../atl/reference/ccomobjectnolock-class.md) Implements `IUnknown` for a nonaggregated object, without modifying the module lock count.
2929

30-
- [CComTearOffObject](../atl/reference/ccomtearoffobject-class.md) Implements **IUnknown** for a tear-off interface.
30+
- [CComTearOffObject](../atl/reference/ccomtearoffobject-class.md) Implements `IUnknown` for a tear-off interface.
3131

32-
- [CComCachedTearOffObject](../atl/reference/ccomcachedtearoffobject-class.md) Implements **IUnknown** for a "cached" tear-off interface.
32+
- [CComCachedTearOffObject](../atl/reference/ccomcachedtearoffobject-class.md) Implements `IUnknown` for a "cached" tear-off interface.
3333

34-
- [CComContainedObject](../atl/reference/ccomcontainedobject-class.md) Implements **IUnknown** for the inner object of an aggregation or a tear-off interface.
34+
- [CComContainedObject](../atl/reference/ccomcontainedobject-class.md) Implements `IUnknown` for the inner object of an aggregation or a tear-off interface.
3535

3636
- [CComObjectGlobal](../atl/reference/ccomobjectglobal-class.md) Manages a reference count on the module to ensure your object won't be deleted.
3737

38-
- [CComObjectStack](../atl/reference/ccomobjectstack-class.md) Creates a temporary COM object, using a skeletal implementation of **IUnknown**.
38+
- [CComObjectStack](../atl/reference/ccomobjectstack-class.md) Creates a temporary COM object, using a skeletal implementation of `IUnknown`.
3939

4040
## Related Articles
4141
[Fundamentals of ATL COM Objects](../atl/fundamentals-of-atl-com-objects.md)

docs/atl/linking-to-the-crt-in-your-atl-project.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ ms.workload: ["cplusplus"]
1616
The [C Run-Time Libraries](../c-runtime-library/crt-library-features.md) (CRT) provide many useful functions that can make programming much easier during ATL development. All ATL projects link to the CRT library. You can see the advantages and disadvantages of linking method in [Benefits and Tradeoffs of the Method Used to Link to the CRT](../atl/benefits-and-tradeoffs-of-the-method-used-to-link-to-the-crt.md).
1717

1818
## Effects of Linking to the CRT on Your Program Image
19-
If you statically link to the CRT, code from the CRT is placed in your executable image and you do not need to have the CRT DLL present on a system to run your image. If you dynamically link to the CRT, references to the code in the CRT DLL are placed in your image, but not the code itself. In order for your image to run on a given system, the CRT DLL must be present on that system. Even when you dynamically link to the CRT, you may find that some code can be statically linked (for example, **DllMainCRTStartup**).
19+
If you statically link to the CRT, code from the CRT is placed in your executable image and you do not need to have the CRT DLL present on a system to run your image. If you dynamically link to the CRT, references to the code in the CRT DLL are placed in your image, but not the code itself. In order for your image to run on a given system, the CRT DLL must be present on that system. Even when you dynamically link to the CRT, you may find that some code can be statically linked (for example, `DllMainCRTStartup`).
2020

21-
When you link your image, you either explicitly or implicitly specify an entry point that the operating system will call into after loading the image. For a DLL, the default entry point is **DllMainCRTStartup**. For an EXE, it is **WinMainCRTStartup**. You can override the default with the /ENTRY linker option. The CRT provides an implementation for **DllMainCRTStartup**, **WinMainCRTStartup**, and **wWinMainCRTStartup** (the Unicode entry point for an EXE). These CRT-provided entry points call constructors on global objects and initialize other data structures that are used by some CRT functions. This startup code adds about 25K to your image if it is linked statically. If it is linked dynamically, most of the code is in the DLL, so your image size stays small.
21+
When you link your image, you either explicitly or implicitly specify an entry point that the operating system will call into after loading the image. For a DLL, the default entry point is `DllMainCRTStartup`. For an EXE, it is `WinMainCRTStartup`. You can override the default with the /ENTRY linker option. The CRT provides an implementation for `DllMainCRTStartup`, `WinMainCRTStartup`, and `wWinMainCRTStartup` (the Unicode entry point for an EXE). These CRT-provided entry points call constructors on global objects and initialize other data structures that are used by some CRT functions. This startup code adds about 25K to your image if it is linked statically. If it is linked dynamically, most of the code is in the DLL, so your image size stays small.
2222

2323
For more information, see the linker topic [/ENTRY (Entry-Point Symbol)](../build/reference/entry-entry-point-symbol.md).
2424

0 commit comments

Comments
 (0)