Skip to content

Commit f09a522

Browse files
authored
Merge pull request #1144 from msebolt/formatting-review-pr2
ole formatting review pr2
2 parents 3a549f1 + 47a9548 commit f09a522

30 files changed

Lines changed: 125 additions & 187 deletions

docs/data/oledb/consumer-wizard-generated-classes.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ When you use the ATL OLE DB Consumer Wizard to generate a consumer, you have the
3030
> If you modify the user record class or write your own consumer, the data variables must come before the status and length variables.
3131
3232
> [!NOTE]
33-
> The ATL OLE DB Consumer Wizard uses the **DB_NUMERIC** type to bind numeric data types. It formerly used **DBTYPE_VARNUMERIC** (the format of which is described by the **DB_VARNUMERIC** type; see Oledb.h). If you do not use the wizard to create consumers, it is recommended that you use **DB_NUMERIC**.
33+
> The ATL OLE DB Consumer Wizard uses the `DB_NUMERIC` type to bind numeric data types. It formerly used `DBTYPE_VARNUMERIC` (the format of which is described by the `DB_VARNUMERIC` type; see Oledb.h). If you do not use the wizard to create consumers, it is recommended that you use `DB_NUMERIC`.
3434
35-
```
35+
```cpp
3636
// Products.H : Declaration of the CProducts class
3737

3838
class CProductsAccessor
@@ -78,7 +78,7 @@ public:
7878
### Rowset Properties
7979
Next, the wizard sets rowset properties. If you selected **Change**, **Insert**, or **Delete** in the ATL OLE DB Consumer Wizard, the appropriate properties are set here (DBPROP_IRowsetChange is always set, then one or more of DBPROPVAL_UP_CHANGE, DBPROPVAL_UP_INSERT, and/or DBPROPVAL_UP_DELETE, respectively).
8080
81-
```
81+
```cpp
8282
void GetRowsetProperties(CDBPropSet* pPropSet)
8383
{
8484
pPropSet->AddProperty(DBPROP_CANFETCHBACKWARDS, true, DBPROPOPTIONS_OPTIONAL);
@@ -91,7 +91,7 @@ void GetRowsetProperties(CDBPropSet* pPropSet)
9191
### Command or Table Class
9292
If you specify a command class, the wizard declares the command class; for templated code, the command looks like this:
9393

94-
```
94+
```cpp
9595
DEFINE_COMMAND_EX(CProductsAccessor, L" \
9696
SELECT \
9797
ProductID, \
@@ -110,7 +110,7 @@ SELECT \
110110
### Column Map
111111
The wizard then generates the column bindings or column map. To fix several issues with some providers, the following code might bind columns in a different order than that reported by the provider.
112112
113-
```
113+
```cpp
114114
BEGIN_COLUMN_MAP(CProductsAccessor)
115115
COLUMN_ENTRY_LENGTH_STATUS(1, m_ProductID, m_dwProductIDLength, m_dwProductIDStatus)
116116
COLUMN_ENTRY_LENGTH_STATUS(2, m_ProductName, m_dwProductNameLength, m_dwProductNameStatus)
@@ -129,7 +129,7 @@ SELECT \
129129
### Class Declaration
130130
Finally, the wizard generates a command class declaration such as the following:
131131

132-
```
132+
```cpp
133133
class CProducts : public CCommand<CAccessor<CProductsAccessor>>
134134
```
135135
@@ -140,7 +140,7 @@ class CProducts : public CCommand<CAccessor<CProductsAccessor>>
140140
141141
In the following example, the wizard generates a declaration for the class `COrders`, but the user record class `COrdersAccessor` does not appear, because the attributes inject it.
142142
143-
```
143+
```cpp
144144
#define _ATL_ATTRIBUTES
145145
#include <atlbase.h>
146146
#include <atldbcli.h>

docs/data/oledb/consumer-wizard-generated-methods.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ The ATL OLE DB Consumer Wizard and the MFC Application Wizard generate certain f
2828

2929
## OpenAll and CloseAll
3030

31-
```
31+
```cpp
3232
HRESULT OpenAll(); 
3333

3434
void CloseAll();
3535
```
3636

37-
The following example shows how you can call `OpenAll` and `CloseAll` when you execute the same command repeatedly. Compare the code example in [CCommand::Close](../../data/oledb/ccommand-close.md), which shows a variation that calls **Close** and `ReleaseCommand` instead of `CloseAll`.
37+
The following example shows how you can call `OpenAll` and `CloseAll` when you execute the same command repeatedly. Compare the code example in [CCommand::Close](../../data/oledb/ccommand-close.md), which shows a variation that calls `Close` and `ReleaseCommand` instead of `CloseAll`.
3838

39-
```
39+
```cpp
4040
int main(int argc, char* argv[])
4141
{
4242
HRESULT hr;
@@ -72,14 +72,14 @@ int main(int argc, char* argv[])
7272
7373
## OpenRowset
7474
75-
```
75+
```cpp
7676
// OLE DB Template version: 
7777
HRESULT OpenRowset(DBPROPSET* pPropSet = NULL)
7878
// Attribute-injected version:
7979
HRESULT OpenRowset(const CSession& session, LPCWSTR szCommand = NULL);
8080
```
8181

82-
**OpenAll** calls this method to open the rowset or rowsets in the consumer. Typically, you do not need to call `OpenRowset` unless you want to work with multiple data sources/sessions/rowsets. `OpenRowset` is declared in the command or table class header file:
82+
`OpenAll` calls this method to open the rowset or rowsets in the consumer. Typically, you do not need to call `OpenRowset` unless you want to work with multiple data sources/sessions/rowsets. `OpenRowset` is declared in the command or table class header file:
8383

8484
```
8585
// OLE DB Template version:
@@ -96,7 +96,7 @@ HRESULT OpenRowset(DBPROPSET *pPropSet = NULL)
9696

9797
The attributes implement this method differently. This version takes a session object and a command string that defaults to the command string specified in db_command, although you can pass a different one. Note that if you define a `HasBookmark` method, the `OpenRowset` code sets the DBPROP_IRowsetLocate property; make sure you only do this if your provider supports that property.
9898

99-
```
99+
```cpp
100100
// Attribute-injected version:
101101
HRESULT OpenRowset(const CSession& session, LPCWSTR szCommand=NULL)
102102
{
@@ -115,13 +115,13 @@ HRESULT OpenRowset(const CSession& session, LPCWSTR szCommand=NULL)
115115
116116
## GetRowsetProperties
117117
118-
```
118+
```cpp
119119
void GetRowsetProperties(CDBPropSet* pPropSet);
120120
```
121121

122122
This method retrieves a pointer to the rowset's property set; you can use this pointer to set properties such as DBPROP_IRowsetChange. `GetRowsetProperties` is used in the user record class as follows. You can modify this code to set additional rowset properties:
123123

124-
```
124+
```cpp
125125
void GetRowsetProperties(CDBPropSet* pPropSet)
126126
{
127127
pPropSet->AddProperty(DBPROP_CANFETCHBACKWARDS, true, DBPROPOPTIONS_OPTIONAL);
@@ -136,7 +136,7 @@ void GetRowsetProperties(CDBPropSet* pPropSet)
136136
137137
## OpenDataSource and CloseDataSource
138138
139-
```
139+
```cpp
140140
HRESULT OpenDataSource(); 
141141
142142
void CloseDataSource();

docs/data/oledb/creating-a-consumer-without-using-a-wizard.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The following example assumes that you are adding OLE DB consumer support to an
1818

1919
- In your Stdafx.h file, append the following `#include` statements:
2020

21-
```
21+
```cpp
2222
#include <atlbase.h>
2323
#include <atldbcli.h>
2424
#include <atldbsch.h> // if you are using schema templates
@@ -33,23 +33,23 @@ The following example assumes that you are adding OLE DB consumer support to an
3333

3434
- Instantiate a data source and a session. Decide what type of accessor and rowset to use and then instantiate a rowset using [CCommand](../../data/oledb/ccommand-class.md) or [CTable](../../data/oledb/ctable-class.md):
3535

36-
```
36+
```cpp
3737
CDataSource ds;
3838
CSession ss;
3939
class CMyTableName : public CCommand<CAccessor<CMyTableNameAccessor>>
4040
```
4141

42-
- Call **CoInitialize** to initialize COM. This is usually called in the main code. For example:
42+
- Call `CoInitialize` to initialize COM. This is usually called in the main code. For example:
4343

44-
```
44+
```cpp
4545
HRESULT hr = CoInitialize(NULL);
4646
```
4747

4848
- Call [CDataSource::Open](../../data/oledb/cdatasource-open.md) or one of its variations.
4949

5050
- Open a connection to the data source, open the session, and open and initialize the rowset (and if a command, also execute it):
5151

52-
```
52+
```cpp
5353
hr = ds.Open();
5454
hr = ss.Open(ds);
5555
hr = rs.Open(); // (Open also executes the command)
@@ -61,15 +61,15 @@ The following example assumes that you are adding OLE DB consumer support to an
6161

6262
- When your application is done, close the connection, session, and rowset:
6363

64-
```
64+
```cpp
6565
rs.Close();
6666
ss.Close();
6767
ds.Close();
6868
```
6969

70-
If you are using a command, you might want to call `ReleaseCommand` after **Close**. The code example in [CCommand::Close](../../data/oledb/ccommand-close.md) shows how to call **Close** and `ReleaseCommand`.
70+
If you are using a command, you might want to call `ReleaseCommand` after `Close`. The code example in [CCommand::Close](../../data/oledb/ccommand-close.md) shows how to call `Close` and `ReleaseCommand`.
7171

72-
- Call **CoUnInitialize** to uninitialize COM. This is usually called in the main code.
72+
- Call `CoUnInitialize` to uninitialize COM. This is usually called in the main code.
7373

7474
```
7575
CoUninitialize();

docs/data/oledb/creating-a-project-for-the-provider.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ ms.author: "mblome"
1212
ms.workload: ["cplusplus", "data-storage"]
1313
---
1414
# Creating a Project for the Provider
15-
#### To create a project in which the OLE DB provider will reside
15+
### To create a project in which the OLE DB provider will reside
1616

17-
1. From the **File** menu, click `New`, and then click **Project**.
17+
1. From the **File** menu, click **New**, and then click **Project**.
1818

1919
The **New Project** dialog box appears.
2020

docs/data/oledb/creating-a-simple-consumer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.workload: ["cplusplus", "data-storage"]
1414
# Creating a Simple Consumer
1515
Use the ATL Project Wizard and ATL OLE DB Consumer Wizard to generate an OLE DB Templates consumer.
1616

17-
#### To create a console application for an OLE DB consumer
17+
### To create a console application for an OLE DB consumer
1818

1919
1. On the **File** menu, click **New**, and then click **Project**.
2020

@@ -90,7 +90,7 @@ Use the ATL Project Wizard and ATL OLE DB Consumer Wizard to generate an OLE DB
9090
> [!NOTE]
9191
> The wizard puts the following line into Products.h:
9292
93-
```
93+
```cpp
9494
#error Security Issue: The connection string may contain a password
9595
```
9696

docs/data/oledb/creating-an-updatable-provider.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Visual C++ supports updatable providers or providers that can update (write to)
1717

1818
This topic assumes that you are starting with a workable provider. There are two steps to creating an updatable provider. You must first decide how the provider will make changes to the data store; specifically, whether changes are to be done immediately or deferred until an update command is issued. The section "[Making Providers Updatable](#vchowmakingprovidersupdatable)" describes the changes and settings you need to do in the provider code.
1919

20-
Next, you must make sure your provider contains all the functionality to support anything the consumer might request of it. If the consumer wants to update the data store, the provider has to contain code that persists data to the data store. For example, you might use the C Run-Time Library or MFC to perform such operations on your data source. The section "[Writing to the Data Source](#vchowwritingtothedatasource)" describes how to write to the data source, deal with `NULL` and default values, and set column flags.
20+
Next, you must make sure your provider contains all the functionality to support anything the consumer might request of it. If the consumer wants to update the data store, the provider has to contain code that persists data to the data store. For example, you might use the C Run-Time Library or MFC to perform such operations on your data source. The section "[Writing to the Data Source](#vchowwritingtothedatasource)" describes how to write to the data source, deal with NULL and default values, and set column flags.
2121

2222
> [!NOTE]
2323
> UpdatePV is an example of an updatable provider. UpdatePV is the same as MyProv but with updatable support.
@@ -42,7 +42,7 @@ Visual C++ supports updatable providers or providers that can update (write to)
4242

4343
Add `IRowsetChangeImpl` to your inheritance chain using this form:
4444

45-
```
45+
```cpp
4646
IRowsetChangeImpl< rowset-name, storage-name >
4747
```
4848

@@ -52,7 +52,7 @@ Visual C++ supports updatable providers or providers that can update (write to)
5252

5353
Add `IRowsetUpdate` to your inheritance chain using this form:
5454

55-
```
55+
```cpp
5656
IRowsetUpdateImpl< rowset-name, storage>
5757
```
5858

@@ -75,7 +75,7 @@ Visual C++ supports updatable providers or providers that can update (write to)
7575

7676
4. In your property set map, you should also include all of the following settings as they appear below:
7777

78-
```
78+
```cpp
7979
PROPERTY_INFO_ENTRY_VALUE(UPDATABILITY, DBPROPVAL_UP_CHANGE |
8080
DBPROPVAL_UP_INSERT | DBPROPVAL_UP_DELETE)
8181
PROPERTY_INFO_ENTRY_VALUE(CHANGEINSERTEDROWS, VARIANT_TRUE)

docs/data/oledb/crestrictions-class.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ A generic class that allows you to specify restrictions for schema rowsets.
2020
```cpp
2121
template <class T, short nRestrictions, const GUID* pguid>
2222
class CRestrictions :
23-
public CSchemaRowset <T, nRestrictions>
23+
public CSchemaRowset <T, nRestrictions>
2424
```
2525
26-
#### Parameters
26+
### Parameters
2727
*T*
2828
The class used for the accessor.
2929

0 commit comments

Comments
 (0)