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
`Class CString` is based on class template [CStringT Class](../atl-mfc-shared/reference/cstringt-class.md). `CString` is a `typedef` of `CStringT`. More exactly, `CString` is a `typedef` of an *explicit specialization* of `CStringT`, which is a common way to use a class template to define a class. Similarly defined classes are `CStringA` and `CStringW`. For more information on explicit specialization, see [Class Template Instantiation](../topic/class%20template%20instantiation.md).
53
+
`Class CString` is based on class template [CStringT Class](../atl-mfc-shared/reference/cstringt-class.md). `CString` is a `typedef` of `CStringT`. More exactly, `CString` is a `typedef` of an *explicit specialization* of `CStringT`, which is a common way to use a class template to define a class. Similarly defined classes are `CStringA` and `CStringW`.
54
54
55
55
`CString`, `CStringA`, and `CStringW` are defined in atlstr.h. `CStringT` is defined in cstringt.h.
Copy file name to clipboardExpand all lines: docs/atl-mfc-shared/cfixedstringt-example-of-a-custom-string-manager.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
@@ -70,7 +70,7 @@ The ATL library implements one example of a custom string manager used by class
70
70
## Implementation of CFixedStringMgr::GetNilString
71
71
The implementation of **CFixedStringMgr::GetNilString** returns the fixed buffer. Because of the one-on-one correspondence of **CFixedStringMgr** and `CStringT`, a given instance of `CStringT` never uses more than one buffer at a time. Therefore, a nil string and a real string buffer are never needed at the same time.
72
72
73
-
Whenever the fixed buffer is not in use, **CFixedStringMgr** ensures that it is initialized with a zero length. This allows it to be used as the nil string. As an added bonus, the `nAllocLength` member of the fixed buffer is always set to the full size of the fixed buffer. This means that `CStringT` can grow the string without calling [IAtlStringMgr::Reallocate](../atl-mfc-shared/reference/iatlstringmgr-class.md#reallocate), even for the nil string.
73
+
Whenever the fixed buffer is not in use, **CFixedStringMgr** ensures that it is initialized with a zero length. This allows it to be used as the nil string. As an added bonus, the `nAllocLength` member of the fixed buffer is always set to the full size of the fixed buffer. This means that `CStringT` can grow the string without calling [IAtlStringMgr::Reallocate](../atl-mfc-shared/reference/iatlstringmgr-class.md#iatlstringmgr__reallocate), even for the nil string.
Copy file name to clipboardExpand all lines: docs/atl-mfc-shared/date-and-time-automation-support.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
@@ -55,7 +55,7 @@ This article describes how to take advantage of the class library services relat
55
55
56
56
The `COleDateTime` and `COleDateTimeSpan` classes are designed to be used with the `COleVariant` class used in Automation. `COleDateTime` and `COleDateTimeSpan` are also useful in MFC database programming, but they can be used whenever you want to manipulate date and time values. Although the `COleDateTime` class has a greater range of values and finer granularity than the `CTime` class, it requires more storage per object than `CTime`. There are also some special considerations when working with the underlying **DATE** type. See [The DATE Type](../atl-mfc-shared/date-type.md) for more details on the implementation of **DATE**.
57
57
58
-
`COleDateTime` objects can be used to represent dates between January 1, 100, and December 31, 9999. `COleDateTime` objects are floating point values, with an approximate resolution of 1 millisecond. `COleDateTime` is based on the **DATE** data type, defined in the MFC documentation under [COleDateTime::operator DATE](../atl-mfc-shared/reference/coledatetime-class.md#operator%20date). The actual implementation of **DATE** extends beyond these bounds. The `COleDateTime` implementation imposes these bounds to facilitate working with the class.
58
+
`COleDateTime` objects can be used to represent dates between January 1, 100, and December 31, 9999. `COleDateTime` objects are floating point values, with an approximate resolution of 1 millisecond. `COleDateTime` is based on the **DATE** data type, defined in the MFC documentation under [COleDateTime::operator DATE](../atl-mfc-shared/reference/coledatetime-class.md#coledatetime__operator%20date). The actual implementation of **DATE** extends beyond these bounds. The `COleDateTime` implementation imposes these bounds to facilitate working with the class.
59
59
60
60
`COleDateTime` does not support Julian dates. The Gregorian calendar is assumed to extend back in time to January 1, 100.
Copy file name to clipboardExpand all lines: docs/atl-mfc-shared/implementation-of-a-custom-string-manager-advanced-method.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,13 +39,13 @@ In specialized situations, you might want to implement a custom string manager t
39
39
40
40
The `CStringData` structure comprises four fields:
41
41
42
-
-[pStringMgr](../atl-mfc-shared/reference/cstringdata-class.md#pstringmgr) This field points to the `IAtlStringMgr` interface used to manage this string data. When `CStringT` needs to reallocate or free the string buffer it calls the Reallocate or Free methods of this interface, passing the `CStringData` structure as a parameter. When allocating a `CStringData` structure in your string manager, you must set this field to point to your custom string manager.
42
+
-[pStringMgr](../atl-mfc-shared/reference/cstringdata-class.md#cstringdata__pstringmgr) This field points to the `IAtlStringMgr` interface used to manage this string data. When `CStringT` needs to reallocate or free the string buffer it calls the Reallocate or Free methods of this interface, passing the `CStringData` structure as a parameter. When allocating a `CStringData` structure in your string manager, you must set this field to point to your custom string manager.
43
43
44
-
-[nDataLength](../atl-mfc-shared/reference/cstringdata-class.md#ndatalength) This field contains the current logical length of the string stored in the buffer excluding the terminating null. `CStringT` updates this field when the length of the string changes. When allocating a `CStringData` structure, your string manager must set this field to zero. When reallocating a `CStringData` structure, your custom string manager must leave this field unchanged.
44
+
-[nDataLength](../atl-mfc-shared/reference/cstringdata-class.md#cstringdata__ndatalength) This field contains the current logical length of the string stored in the buffer excluding the terminating null. `CStringT` updates this field when the length of the string changes. When allocating a `CStringData` structure, your string manager must set this field to zero. When reallocating a `CStringData` structure, your custom string manager must leave this field unchanged.
45
45
46
-
- [nAllocLength](../atl-mfc-shared/reference/cstringdata-class.md#nalloclength) This field contains the maximum number of characters (excluding the terminating null) that can be stored in this string buffer without reallocating it. Whenever `CStringT` needs to increase the logical length of the string, it first checks this field to make sure there is enough space in the buffer. If the check fails, `CStringT` calls into your custom string manager to reallocate the buffer. When allocating or reallocating a `CStringData` structure, you must set this field to at least the number of characters requested in the **nChars** parameter to [IAtlStringMgr::Allocate](../atl-mfc-shared/reference/iatlstringmgr-class.md#allocate) or [IAtlStringMgr::Reallocate](../atl-mfc-shared/reference/iatlstringmgr-class.md#reallocate). If there is more space in the buffer than requested, you can set this value to reflect the actual amount of space available. This allows `CStringT` to grow the string to fill the entire allocated space before it has to call back into the string manager to reallocate the buffer.
46
+
- [nAllocLength](../atl-mfc-shared/reference/cstringdata-class.md#cstringdata__nalloclength) This field contains the maximum number of characters (excluding the terminating null) that can be stored in this string buffer without reallocating it. Whenever `CStringT` needs to increase the logical length of the string, it first checks this field to make sure there is enough space in the buffer. If the check fails, `CStringT` calls into your custom string manager to reallocate the buffer. When allocating or reallocating a `CStringData` structure, you must set this field to at least the number of characters requested in the **nChars** parameter to [IAtlStringMgr::Allocate](../atl-mfc-shared/reference/iatlstringmgr-class.md#iatlstringmgr__allocate) or [IAtlStringMgr::Reallocate](../atl-mfc-shared/reference/iatlstringmgr-class.md#iatlstringmgr__reallocate). If there is more space in the buffer than requested, you can set this value to reflect the actual amount of space available. This allows `CStringT` to grow the string to fill the entire allocated space before it has to call back into the string manager to reallocate the buffer.
47
47
48
-
- [nRefs](../atl-mfc-shared/reference/cstringdata-class.md#nrefs) This field contains the current reference count of the string buffer. If the value is one, then a single instance of `CStringT` is using the buffer. In addition, the instance is allowed to both read and modify the contents of the buffer. If the value is greater than one, multiple instances of `CStringT` can use the buffer. Because the character buffer is shared, `CStringT` instances can only read the contents of the buffer. To modify the contents, `CStringT` first makes a copy of the buffer. If the value is negative, only one instance of `CStringT` is using the buffer. In this case, the buffer is considered locked. When a `CStringT` instance is using a locked buffer no other instances of `CStringT` may share the buffer. Instead, these instances create a copy of the buffer before manipulating the contents. In addition, the `CStringT` instance using the locked buffer does not attempt to share the buffer of any other `CStringT` instance assigned to it. In this case, the `CStringT` instance copies the other string into the locked buffer.
48
+
- [nRefs](../atl-mfc-shared/reference/cstringdata-class.md#cstringdata__nrefs) This field contains the current reference count of the string buffer. If the value is one, then a single instance of `CStringT` is using the buffer. In addition, the instance is allowed to both read and modify the contents of the buffer. If the value is greater than one, multiple instances of `CStringT` can use the buffer. Because the character buffer is shared, `CStringT` instances can only read the contents of the buffer. To modify the contents, `CStringT` first makes a copy of the buffer. If the value is negative, only one instance of `CStringT` is using the buffer. In this case, the buffer is considered locked. When a `CStringT` instance is using a locked buffer no other instances of `CStringT` may share the buffer. Instead, these instances create a copy of the buffer before manipulating the contents. In addition, the `CStringT` instance using the locked buffer does not attempt to share the buffer of any other `CStringT` instance assigned to it. In this case, the `CStringT` instance copies the other string into the locked buffer.
49
49
50
50
When allocating a `CStringData` structure, you must set this field to reflect the type of sharing that is allowed for the buffer. For most implementations, set this value to one. This allows the usual copy-on-write sharing behavior. However, if your string manager does not support sharing the string buffer, set this field to a locked state. This forces `CStringT` to only use this buffer for the instance of `CStringT` that allocated it.
When you use `CImage` in an MFC project, note which member functions in your project expect a pointer to a [CBitmap](../../mfc/reference/cbitmap-class.md) object. If you want to use `CImage` with such a function, like [CMenu::AppendMenu](../../mfc/reference/cmenu-class.md#cmenu__appendmenu), use [CBitmap::FromHandle](../../mfc/reference/cbitmap-class.md#cbitmap__fromhandle), pass it your `CImage``HBITMAP`, and use the returned `CBitmap*`.
|[TransparentBlt](#cimage__transparentblt)|Works with only Windows 2000, Windows 98, and later systems.|
162
163
|[Draw](#cimage__draw)|Supports transparency with only Windows 2000, Windows 98, and later systems.|
163
164
164
-
165
165
You can use `CImage` from either MFC or ATL.
166
166
167
167
> [!NOTE]
@@ -256,9 +256,7 @@ BOOL AlphaBlend(HDC hDestDC,
256
256
Alpha-blend bitmaps support color blending on a per-pixel basis.
257
257
258
258
When `bBlendOp` is set to the default of **AC_SRC_OVER**, the source bitmap is placed over the destination bitmap based on the alpha values of the source pixels.
259
-
260
-
This method is applicable to Microsoft Windows 2000, Windows 98, and later systems. See [AlphaBlend](http://msdn.microsoft.com/library/windows/desktop/dd183351) in the [!INCLUDE[winSDK](./includes/winsdk_md.md)] for more detailed information.
If the application is compiled for use with operating systems before Windows 2000 or Windows 98, this method will always return 0, even on newer operating systems.
914
912
915
-
913
+
916
914
## <aname="cimage__load"></a> CImage::Load
917
915
Loads an image.
918
916
@@ -1048,8 +1046,6 @@ BOOL MaskBlt(HDC hDestDC,
1048
1046
### Remarks
1049
1047
This method applies to Windows NT, versions 4.0 and later only.
1050
1048
1051
-
See `MaskBlt` in the [!INCLUDE[winsdkshort](./includes/winsdkshort_md.md)] for more detailed information.
Use this operator to get the attached Windows GDI handle of the `CImage` object. This operator is a casting operator, which supports direct use of an `HBITMAP` object.
`TransparentBlt` is supported for source bitmaps of 4 bits per pixel and 8 bits per pixel. Use [CImage::AlphaBlend](#cimage__alphablend) to specify 32 bits-per-pixel bitmaps with transparency.
1438
1434
1439
-
This method is applicable to Microsoft Windows 2000, Windows 98, and later systems. See [TransparentBlt](http://msdn.microsoft.com/library/windows/desktop/dd145141) in the [!INCLUDE[winSDK](./includes/winsdk_md.md)] for more detailed information.
Copy file name to clipboardExpand all lines: docs/atl-mfc-shared/reference/crect-class.md
+13-7Lines changed: 13 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,13 +112,14 @@ class CRect : public tagRECT
112
112
113
113
When specifying a `CRect`, you must be careful to construct it so that it is normalized — in other words, such that the value of the left coordinate is less than the right and the top is less than the bottom. For example, a top left of (10,10) and bottom right of (20,20) defines a normalized rectangle but a top left of (20,20) and bottom right of (10,10) defines a non-normalized rectangle. If the rectangle is not normalized, many `CRect` member functions may return incorrect results. (See [CRect::NormalizeRect](#crect__normalizerect) for a list of these functions.) Before you call a function that requires normalized rectangles, you can normalize non-normalized rectangles by calling the `NormalizeRect` function.
114
114
115
+
<<<<<<< HEAD
115
116
Use caution when manipulating a `CRect` with the [CDC::DPtoLP](../../mfc/reference/cdc-class.md#cdc__dptolp) and [CDC::LPtoDP](../../mfc/reference/cdc-class.md#cdc__lptodp) member functions. If the mapping mode of a display context is such that the y-extent is negative, as in `MM_LOENGLISH`, then `CDC::DPtoLP` will transform the `CRect` so that its top is greater than the bottom. Functions such as **Height** and **Size** will then return negative values for the height of the transformed `CRect`, and the rectangle will be non-normalized.
117
+
=======
118
+
Use caution when manipulating a `CRect` with the [CDC::DPtoLP](../../mfc/reference/cdc-class.md#cdc__dptolp and [CDC::LPtoDP](../../mfc/reference/cdc-class.md#cdc__lptodp member functions. If the mapping mode of a display context is such that the y-extent is negative, as in `MM_LOENGLISH`, then `CDC::DPtoLP` will transform the `CRect` so that its top is greater than the bottom. Functions such as **Height** and **Size** will then return negative values for the height of the transformed `CRect`, and the rectangle will be non-normalized.
119
+
>>>>>>> master
116
120
117
121
When using overloaded `CRect` operators, the first operand must be a `CRect`; the second can be either a [RECT](../../mfc/reference/rect-structure1.md) structure or a `CRect` object.
118
122
119
-
> [!NOTE]
120
-
> For more information on shared utility classes (like `CRect`), see [Shared Classes](../topic/atl-mfc%20shared%20classes.md).
0 commit comments