Skip to content

Commit d300d72

Browse files
author
Matthew Sebolt
authored
Code escape pr13 (MicrosoftDocs#3533)
* initial * adjustments * Update cwnd-class.md * adjustment * Update cdc-class.md * Update cdc-class.md * Update cdc-class.md * Update cdc-class.md * Update ccombstr-class.md * Update clistctrl-class.md Fixing italic/coding formatting Co-authored-by: Shannon Leavitt <V-SHLEAV>
1 parent 85191bc commit d300d72

File tree

13 files changed

+5705
-5705
lines changed

13 files changed

+5705
-5705
lines changed

docs/atl-mfc-shared/reference/cstringt-class.md

Lines changed: 33 additions & 33 deletions
Large diffs are not rendered by default.

docs/atl-mfc-shared/using-cstring.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ ms.date: "06/18/2018"
55
helpviewer_keywords: ["CString objects, C++ string manipulation", "CString objects, reference counting", "CString class (Visual C++)"]
66
ms.assetid: ed018aaf-8b10-46f9-828c-f9c092dc7609
77
---
8-
# Using CString
8+
# Using `CString`
99

10-
The topics in this section describe how to program with `CString`. For reference documentation about the `CString` class, see the documentation for [CStringT](../atl-mfc-shared/reference/cstringt-class.md).
10+
The topics in this section describe how to program with `CString`. For reference documentation about the `CString` class, see the documentation for [`CStringT`](../atl-mfc-shared/reference/cstringt-class.md).
1111

1212
To use `CString`, include the `atlstr.h` header.
1313

14-
The `CString`, `CStringA`, and `CStringW` classes are specializations of a class template called [CStringT](../atl-mfc-shared/reference/cstringt-class.md) based on the type of character data they support.
14+
The `CString`, `CStringA`, and `CStringW` classes are specializations of a class template called [`CStringT`](../atl-mfc-shared/reference/cstringt-class.md) based on the type of character data they support.
1515

1616
A `CStringW` object contains the **`wchar_t`** type and supports Unicode strings. A `CStringA` object contains the **`char`** type, and supports single-byte and multi-byte (MBCS) strings. A `CString` object supports either the **`char`** type or the **`wchar_t`** type, depending on whether the MBCS symbol or the UNICODE symbol is defined at compile time.
1717

18-
A `CString` object keeps character data in a `CStringData` object. `CString` accepts NULL-terminated C-style strings. `CString` tracks the string length for faster performance, but it also retains the NULL character in the stored character data to support conversion to LPCWSTR. `CString` includes the null terminator when it exports a C-style string. You can insert a NULL at other locations in a `CString`, but it may produce unexpected results.
18+
A `CString` object keeps character data in a `CStringData` object. `CString` accepts NULL-terminated C-style strings. `CString` tracks the string length for faster performance, but it also retains the `NULL` character in the stored character data to support conversion to `LPCWSTR`. `CString` includes the null terminator when it exports a C-style string. You can insert a `NULL` at other locations in a `CString`, but it may produce unexpected results.
1919

2020
The following set of string classes can be used without linking an MFC library, with or without CRT support: `CAtlString`, `CAtlStringA`, and `CAtlStringW`.
2121

@@ -36,7 +36,7 @@ int main() {
3636

3737
## In This Section
3838

39-
[Basic CString Operations](../atl-mfc-shared/basic-cstring-operations.md)<br/>
39+
[Basic `CString` Operations](../atl-mfc-shared/basic-cstring-operations.md)<br/>
4040
Describes basic `CString` operations, including creating objects from C literal strings, accessing individual characters in a `CString`, concatenating two objects, and comparing `CString` objects.
4141

4242
[String Data Management](../atl-mfc-shared/string-data-management.md)<br/>
@@ -48,24 +48,24 @@ Explains how `CString` objects are used.
4848
[CString Operations Relating to C-Style Strings](../atl-mfc-shared/cstring-operations-relating-to-c-style-strings.md)<br/>
4949
Describes manipulating the contents of a `CString` object like a C-style null-terminated string.
5050

51-
[Allocating and Releasing Memory for a BSTR](../atl-mfc-shared/allocating-and-releasing-memory-for-a-bstr.md)<br/>
52-
Discusses using memory for a BSTR and COM objects.
51+
[Allocating and Releasing Memory for a `BSTR`](../atl-mfc-shared/allocating-and-releasing-memory-for-a-bstr.md)<br/>
52+
Discusses using memory for a `BSTR` and COM objects.
5353

5454
[CString Exception Cleanup](../atl-mfc-shared/cstring-exception-cleanup.md)<br/>
5555
Explains that explicit cleanup in MFC 3.0 and later is no longer necessary.
5656

5757
[CString Argument Passing](../atl-mfc-shared/cstring-argument-passing.md)<br/>
58-
Explains how to pass CString objects to functions and how to return `CString` objects from functions.
58+
Explains how to pass `CString` objects to functions and how to return `CString` objects from functions.
5959

6060
[Unicode and Multibyte Character Set (MBCS) Support](../atl-mfc-shared/unicode-and-multibyte-character-set-mbcs-support.md)<br/>
6161
Discusses how MFC is enabled for Unicode and MBCS support.
6262

6363
## Reference
6464

65-
[CStringT](../atl-mfc-shared/reference/cstringt-class.md)<br/>
65+
[`CStringT`](../atl-mfc-shared/reference/cstringt-class.md)<br/>
6666
Provides reference information about the `CStringT` class.
6767

68-
[CSimpleStringT Class](../atl-mfc-shared/reference/csimplestringt-class.md)<br/>
68+
[`CSimpleStringT` Class](../atl-mfc-shared/reference/csimplestringt-class.md)<br/>
6969
Provides reference information about the `CSimpleStringT` class.
7070

7171
## Related Sections

docs/atl/queryinterface.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ ms.topic: "reference"
66
helpviewer_keywords: ["interfaces, pointers", "interfaces, availability", "QueryInterface method"]
77
ms.assetid: 62fce95e-aafa-4187-b50b-e6611b74c3b3
88
---
9-
# QueryInterface
9+
# `QueryInterface`
1010

11-
Although there are mechanisms by which an object can express the functionality it provides statically (before it is instantiated), the fundamental COM mechanism is to use the `IUnknown` method called [QueryInterface](/windows/win32/api/unknwn/nf-unknwn-iunknown-queryinterface(q)).
11+
Although there are mechanisms by which an object can express the functionality it provides statically (before it is instantiated), the fundamental COM mechanism is to use the `IUnknown` method called [`QueryInterface`](/windows/win32/api/unknwn/nf-unknwn-iunknown-queryinterface(q)).
1212

13-
Every interface is derived from `IUnknown`, so every interface has an implementation of `QueryInterface`. Regardless of implementation, this method queries an object using the IID of the interface to which the caller wants a pointer. If the object supports that interface, `QueryInterface` retrieves a pointer to the interface, while also calling `AddRef`. Otherwise, it returns the E_NOINTERFACE error code.
13+
Every interface is derived from `IUnknown`, so every interface has an implementation of `QueryInterface`. Regardless of implementation, this method queries an object using the `IID` of the interface to which the caller wants a pointer. If the object supports that interface, `QueryInterface` retrieves a pointer to the interface, while also calling `AddRef`. Otherwise, it returns the `E_NOINTERFACE` error code.
1414

15-
Note that you must obey [Reference Counting](../atl/reference-counting.md) rules at all times. If you call `Release` on an interface pointer to decrement the reference count to zero, you should not use that pointer again. Occasionally you may need to obtain a weak reference to an object (that is, you may wish to obtain a pointer to one of its interfaces without incrementing the reference count), but it is not acceptable to do this by calling `QueryInterface` followed by `Release`. The pointer obtained in such a manner is invalid and should not be used. This more readily becomes apparent when [_ATL_DEBUG_INTERFACES](reference/debugging-and-error-reporting-macros.md#_atl_debug_interfaces) is defined, so defining this macro is a useful way of finding reference counting bugs.
15+
Note that you must obey [Reference Counting](../atl/reference-counting.md) rules at all times. If you call `Release` on an interface pointer to decrement the reference count to zero, you should not use that pointer again. Occasionally you may need to obtain a weak reference to an object (that is, you may wish to obtain a pointer to one of its interfaces without incrementing the reference count), but it is not acceptable to do this by calling `QueryInterface` followed by `Release`. The pointer obtained in such a manner is invalid and should not be used. This more readily becomes apparent when [`_ATL_DEBUG_INTERFACES`](reference/debugging-and-error-reporting-macros.md#_atl_debug_interfaces) is defined, so defining this macro is a useful way of finding reference counting bugs.
1616

1717
## See also
1818

1919
[Introduction to COM](../atl/introduction-to-com.md)<br/>
20-
[QueryInterface: Navigating in an Object](/windows/win32/com/queryinterface--navigating-in-an-object)
20+
[`QueryInterface`: Navigating in an Object](/windows/win32/com/queryinterface--navigating-in-an-object)

0 commit comments

Comments
 (0)