简单数据类型类Simple Data Type Classes

下列类封装绘制坐标、字符串以及时间和日期信息,从而能够方便地使用 C++ 语法。The following classes encapsulate drawing coordinates, character strings, and time and date information, allowing convenient use of C++ syntax. 这些对象将作为参数广泛用于类库中 Windows 类的成员函数。These objects are used widely as parameters to the member functions of Windows classes in the class library. 由于 CPointCSizeCRect 分别对应于 大小RECT 结构,因此,在 Windows SDK 中,可以使用这些 c + + 类的对象,只要可以使用这些 c 语言结构。Because CPoint, CSize, and CRect correspond to the POINT, SIZE, and RECT structures, respectively, in the Windows SDK, you can use objects of these C++ classes wherever you can use these C-language structures. 这些类通过其成员函数提供有用的接口。The classes provide useful interfaces through their member functions. CStringT 提供了非常灵活的动态字符串。CStringT provides very flexible dynamic character strings. CTimeCOleDateTimeCTimeSpanCOleTimeSpan 表示时间和日期值。CTime, COleDateTime, CTimeSpan, and COleTimeSpan represent time and date values. 有关这些类的详细信息,请参阅文章 日期和时间For more information about these classes, see the article Date and Time.

以 "" 开头的类 COle 是 OLE 提供的数据类型的封装。The classes that begin with "COle" are encapsulations of data types provided by OLE. 这些数据类型可在 Windows 程序中使用,而不管是否使用其他 OLE 功能。These data types can be used in Windows programs regardless of whether other OLE features are used.

CStringT 类CStringT Class
保留字符串。Holds character strings.

CTimeCTime
保留绝对时间和日期值。Holds absolute time and date values.

COleDateTimeCOleDateTime
OLE 自动化类型 日期 的包装。Wrapper for the OLE automation type DATE. 表示日期和时间值。Represents date and time values.

CTimeSpanCTimeSpan
保留相对时间和日期值。Holds relative time and date values.

COleDateTimeSpanCOleDateTimeSpan
保留相对 COleDateTime 值,如两个 COleDateTime 值之间的差异。Holds relative COleDateTime values, such as the difference between two COleDateTime values.

CPointCPoint
保留坐标 (x, y) 对。Holds coordinate (x, y) pairs.

CSizeCSize
保留距离、相对位置或匹配的值。Holds distance, relative positions, or paired values.

CRectCRect
保留矩形区域的坐标。Holds coordinates of rectangular areas.

CImageListCImageList
提供 Windows 图像列表的功能。Provides the functionality of the Windows image list. 图像列表将与列表控件和树控件一起使用。Image lists are used with list controls and tree controls. 它们还可以用于存储和存档一组大小相同的位图。They can also be used to store and archive a set of same-sized bitmaps.

COleVariantCOleVariant
OLE 自动化类型 变量 的包装。Wrapper for the OLE automation type VARIANT. 变体 中的数据可存储为多种格式。Data in VARIANT s can be stored in many formats.

COleCurrencyCOleCurrency
OLE 自动化类型 货币 的包装,一个固定点算术类型,小数点前有15个数字,后接四位数字。Wrapper for the OLE automation type CURRENCY, a fixed-point arithmetic type, with 15 digits before the decimal point and 4 digits after.

备注

CRectCSizeCPoint 可在 ATL 或 MFC 应用程序中使用。CRect, CSize, and CPoint are usable in either ATL or MFC applications. 此外, CStringT 还提供了一个与 MFC 无关 CString 的类。In addition, CStringT provides an MFC-independent CString-like class. 有关共享实用工具类的详细信息,请参阅 共享类For more information on shared utility classes, see Shared Classes.

请参阅See also

类概述Class Overview