COleVariant Class
Encapsulates the VARIANT data type.
class COleVariant : public tagVARIANT
Members
Public Constructors
Name |
Description |
---|---|
Constructs a COleVariant object. |
Public Methods
Name |
Description |
---|---|
Attaches a VARIANT to a COleVariant. |
|
Changes the variant type of this COleVariant object. |
|
Clears this COleVariant object. |
|
Detaches a VARIANT from a COleVariant and returns the VARIANT. |
|
Retrieves a byte array from an existing variant array. |
|
Sets the string to a particular type, typically ANSI. |
Public Operators
Name |
Description |
---|---|
Converts a COleVariant value into an LPCVARIANT. |
|
Converts a COleVariant object into an LPVARIANT. |
|
Copies a COleVariant value. |
|
Compares two COleVariant values. |
|
Outputs a COleVariant value to CArchive or CDumpContext and inputs a COleVariant object from CArchive. |
Remarks
This data type is used in OLE automation. Specifically, the DISPPARAMS Data Type structure contains a pointer to an array of VARIANT structures. A DISPPARAMS structure is used to pass parameters to IDispatch::Invoke Method.
Note
This class is derived from the VARIANT structure. This means you can pass a COleVariant in a parameter that calls for a VARIANT and that the data members of the VARIANT structure are accessible data members of COleVariant.
The two related MFC classes COleCurrency and COleDateTime encapsulate the variant data types CURRENCY (VT_CY) and DATE (VT_DATE). The COleVariant class is used extensively in the DAO classes; see these classes for typical usage of this class, for example CDaoQueryDef and CDaoRecordset.
For more information, see the VARIANT, CURRENCY, DISPPARAMS Data Type, and IDispatch::Invoke Method entries in the Windows SDK.
For more information on the COleVariant class and its use in OLE automation, see "Passing Parameters in OLE Automation" in the article Automation.
Inheritance Hierarchy
tagVARIANT
COleVariant
Requirements
Header: afxdisp.h