Skip to content

Commit 72050b3

Browse files
authored
Update CComCoClass reference page
1 parent abecbd4 commit 72050b3

File tree

1 file changed

+28
-29
lines changed

1 file changed

+28
-29
lines changed

docs/atl/reference/ccomcoclass-class.md

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
11
---
2-
description: "Learn more about: CComCoClass Class"
32
title: "CComCoClass Class"
3+
description: "Learn more about: CComCoClass Class"
44
ms.date: "11/04/2016"
55
f1_keywords: ["CComCoClass", "ATLCOM/ATL::CComCoClass", "ATLCOM/ATL::CComCoClass::CreateInstance", "ATLCOM/ATL::CComCoClass::Error", "ATLCOM/ATL::CComCoClass::GetObjectCLSID", "ATLCOM/ATL::CComCoClass::GetObjectDescription"]
66
helpviewer_keywords: ["CComCoClass class", "aggregation [C++], aggregation models"]
7-
ms.assetid: 67cfefa4-8df9-47fa-ad58-2d1a1ae25762
87
---
98
# CComCoClass Class
109

1110
This class provides methods for creating instances of a class, and obtaining its properties.
1211

1312
## Syntax
1413

15-
```
14+
```cpp
1615
template <class T, const CLSID* pclsid = &CLSID_NULL>
1716
class CComCoClass
1817
```
1918
2019
#### Parameters
2120
22-
*T*<br/>
21+
*T*\
2322
Your class, derived from `CComCoClass`.
2423
25-
*pclsid*<br/>
24+
*pclsid*\
2625
A pointer to the CLSID of the object.
2726
2827
## Members
2928
3029
### Public Methods
3130
32-
|Name|Description|
33-
|----------|-----------------|
34-
|[CComCoClass::CreateInstance](#createinstance)|(Static) Creates an instance of the class and queries for an interface.|
35-
|[CComCoClass::Error](#error)|(Static) Returns rich error information to the client.|
36-
|[CComCoClass::GetObjectCLSID](#getobjectclsid)|(Static) Returns the object's class identifier.|
37-
|[CComCoClass::GetObjectDescription](#getobjectdescription)|(Static) Override to return the object's description.|
31+
| Name | Description |
32+
| ---------------------------------------------------------- | ----------------------------------------------------------------------- |
33+
| [CComCoClass::CreateInstance](#createinstance) | (Static) Creates an instance of the class and queries for an interface. |
34+
| [CComCoClass::Error](#error) | (Static) Returns rich error information to the client. |
35+
| [CComCoClass::GetObjectCLSID](#getobjectclsid) | (Static) Returns the object's class identifier. |
36+
| [CComCoClass::GetObjectDescription](#getobjectdescription) | (Static) Override to return the object's description. |
3837
3938
## Remarks
4039
@@ -58,23 +57,23 @@ You can override either of these defaults by specifying another macro in your cl
5857
5958
Use these `CreateInstance` functions to create an instance of a COM object and retrieve an interface pointer without using the COM API.
6059
61-
```
62-
template <class Q>
63-
static HRESULT CreateInstance( Q** pp);
60+
```cpp
61+
template <class Q>
62+
static HRESULT CreateInstance(Q** pp);
6463
65-
template <class Q>
64+
template <class Q>
6665
static HRESULT CreateInstance(IUnknown* punkOuter, Q** pp);
6766
```
6867

6968
### Parameters
7069

71-
*Q*<br/>
70+
*Q*\
7271
The COM interface that should be returned via *pp*.
7372

74-
*punkOuter*<br/>
73+
*punkOuter*\
7574
[in] The outer unknown or controlling unknown of the aggregate.
7675

77-
*pp*<br/>
76+
*pp*\
7877
[out] The address of a pointer variable that receives the requested interface pointer if creation succeeds.
7978

8079
### Return Value
@@ -101,7 +100,7 @@ In the following example, `CDocument` is a wizard-generated ATL class derived fr
101100

102101
This static function sets up the `IErrorInfo` interface to provide error information to the client.
103102

104-
```
103+
```cpp
105104
static HRESULT WINAPI Error(
106105
LPCOLESTR lpszDesc,
107106
const IID& iid = GUID_NULL,
@@ -130,7 +129,7 @@ static HRESULT WINAPI Error(
130129
UINT nID,
131130
const IID& iid = GUID_NULL,
132131
HRESULT hRes = 0,
133-
HINSTANCE hInst = _AtlBaseModule.GetResourceInstance ());
132+
HINSTANCE hInst = _AtlBaseModule.GetResourceInstance());
134133

135134
static HRESULT Error(
136135
UINT nID,
@@ -143,25 +142,25 @@ static HRESULT Error(
143142
144143
### Parameters
145144
146-
*lpszDesc*<br/>
145+
*lpszDesc*\
147146
[in] The string describing the error. The Unicode version of `Error` specifies that *lpszDesc* is of type LPCOLESTR; the ANSI version specifies a type of LPCSTR.
148147
149-
*iid*<br/>
148+
*iid*\
150149
[in] The IID of the interface defining the error or GUID_NULL (the default value) if the error is defined by the operating system.
151150
152-
*hRes*<br/>
151+
*hRes*\
153152
[in] The HRESULT you want returned to the caller. The default value is 0. For more details about *hRes*, see Remarks.
154153
155-
*nID*<br/>
154+
*nID*\
156155
[in] The resource identifier where the error description string is stored. This value should lie between 0x0200 and 0xFFFF, inclusively. In debug builds, an **ASSERT** will result if *nID* does not index a valid string. In release builds, the error description string will be set to "Unknown Error."
157156
158-
*dwHelpID*<br/>
157+
*dwHelpID*\
159158
[in] The help context identifier for the error.
160159
161-
*lpszHelpFile*<br/>
160+
*lpszHelpFile*\
162161
[in] The path and name of the help file describing the error.
163162
164-
*hInst*<br/>
163+
*hInst*\
165164
[in] The handle to the resource. By default, this parameter is `_AtlModule::GetResourceInstance`, where `_AtlModule` is the global instance of [CAtlModule](../../atl/reference/catlmodule-class.md).
166165
167166
### Return Value
@@ -178,7 +177,7 @@ If the *hRes* parameter is nonzero, then `Error` returns the value of *hRes*. If
178177
179178
Provides a consistent way of retrieving the object's CLSID.
180179
181-
```
180+
```cpp
182181
static const CLSID& WINAPI GetObjectCLSID();
183182
```
184183

@@ -190,7 +189,7 @@ The object's class identifier.
190189

191190
This static function retrieves the text description for your class object.
192191

193-
```
192+
```cpp
194193
static LPCTSTR WINAPI GetObjectDescription();
195194
```
196195

0 commit comments

Comments
 (0)