ReactOS  0.4.13-dev-242-g611e6d7
ATL::CComVariant Class Reference

#include <atlcomcli.h>

Inheritance diagram for ATL::CComVariant:
Collaboration diagram for ATL::CComVariant:

Public Member Functions

 CComVariant ()
 
 CComVariant (const CComVariant &other)
 
 ~CComVariant ()
 
 CComVariant (LPCOLESTR lpStr)
 
 CComVariant (LPCSTR lpStr)
 
 CComVariant (bool value)
 
 CComVariant (char value)
 
 CComVariant (BYTE value)
 
 CComVariant (short value)
 
 CComVariant (unsigned short value)
 
 CComVariant (int value, VARENUM type=VT_I4)
 
 CComVariant (unsigned int value, VARENUM type=VT_UI4)
 
 CComVariant (long value, VARENUM type=VT_I4)
 
 CComVariant (unsigned long value)
 
 CComVariant (float value)
 
 CComVariant (double value, VARENUM type=VT_R8)
 
 CComVariant (const LONGLONG &value)
 
 CComVariant (const ULONGLONG &value)
 
 CComVariant (const CY &value)
 
HRESULT Clear ()
 
HRESULT Copy (_In_ const VARIANT *src)
 
HRESULT ChangeType (_In_ VARTYPE newType, _In_opt_ const LPVARIANT src=NULL)
 

Additional Inherited Members

- Public Attributes inherited from tagVARIANT
union {
   struct __tagVARIANT {
      VARTYPE   vt
 
      WORD   wReserved1
 
      WORD   wReserved2
 
      WORD   wReserved3
 
      union {
         signed char   cVal
 
         USHORT   uiVal
 
         ULONG   ulVal
 
         INT   intVal
 
         UINT   uintVal
 
         BYTE   bVal
 
         SHORT   iVal
 
         LONG   lVal
 
         FLOAT   fltVal
 
         DOUBLE   dblVal
 
         VARIANT_BOOL   boolVal
 
         SCODE   scode
 
         DATE   date
 
         BSTR   bstrVal
 
         CY   cyVal
 
         IUnknown *   punkVal
 
         IDispatch *   pdispVal
 
         SAFEARRAY *   parray
 
         LONGLONG   llVal
 
         ULONGLONG   ullVal
 
         signed char *   pcVal
 
         USHORT *   puiVal
 
         ULONG *   pulVal
 
         INT *   pintVal
 
         UINT *   puintVal
 
         BYTE *   pbVal
 
         SHORT *   piVal
 
         LONG *   plVal
 
         FLOAT *   pfltVal
 
         DOUBLE *   pdblVal
 
         VARIANT_BOOL *   pboolVal
 
         SCODE *   pscode
 
         DATE *   pdate
 
         BSTR *   pbstrVal
 
         VARIANT *   pvarVal
 
         PVOID   byref
 
         CY *   pcyVal
 
         DECIMAL *   pdecVal
 
         IUnknown **   ppunkVal
 
         IDispatch **   ppdispVal
 
         SAFEARRAY **   pparray
 
         LONGLONG *   pllVal
 
         ULONGLONG *   pullVal
 
         struct __tagBRECORD {
            PVOID   pvRecord
 
            IRecordInfo *   pRecInfo
 
         }   __VARIANT_NAME_4
 
      }   __VARIANT_NAME_3
 
   }   __VARIANT_NAME_2
 
   DECIMAL   decVal
 
__VARIANT_NAME_1
 

Detailed Description

Definition at line 400 of file atlcomcli.h.

Constructor & Destructor Documentation

◆ CComVariant() [1/18]

ATL::CComVariant::CComVariant ( )
inline

Definition at line 403 of file atlcomcli.h.

404  {
405  ::VariantInit(this);
406  }
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571

◆ CComVariant() [2/18]

ATL::CComVariant::CComVariant ( const CComVariant other)
inline

Definition at line 408 of file atlcomcli.h.

409  {
410  V_VT(this) = VT_EMPTY;
411  Copy(&other);
412  }
int other
Definition: msacm.c:1364
#define V_VT(A)
Definition: oleauto.h:211
HRESULT Copy(_In_ const VARIANT *src)
Definition: atlcomcli.h:554

◆ ~CComVariant()

ATL::CComVariant::~CComVariant ( )
inline

Definition at line 414 of file atlcomcli.h.

415  {
416  Clear();
417  }
HRESULT Clear()
Definition: atlcomcli.h:549

◆ CComVariant() [3/18]

ATL::CComVariant::CComVariant ( LPCOLESTR  lpStr)
inline

Definition at line 419 of file atlcomcli.h.

420  {
421  V_VT(this) = VT_BSTR;
422  V_BSTR(this) = ::SysAllocString(lpStr);
423  }
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226

◆ CComVariant() [4/18]

ATL::CComVariant::CComVariant ( LPCSTR  lpStr)
inline

Definition at line 425 of file atlcomcli.h.

426  {
427  V_VT(this) = VT_BSTR;
428  CComBSTR str(lpStr);
429  V_BSTR(this) = str.Detach();
430  }
const WCHAR * str
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226

◆ CComVariant() [5/18]

ATL::CComVariant::CComVariant ( bool  value)
inline

Definition at line 432 of file atlcomcli.h.

433  {
434  V_VT(this) = VT_BOOL;
435  V_BOOL(this) = value ? VARIANT_TRUE : VARIANT_FALSE;
436  }
#define V_BOOL(A)
Definition: oleauto.h:224
#define V_VT(A)
Definition: oleauto.h:211

◆ CComVariant() [6/18]

ATL::CComVariant::CComVariant ( char  value)
inline

Definition at line 438 of file atlcomcli.h.

439  {
440  V_VT(this) = VT_I1;
441  V_I1(this) = value;
442  }
Definition: compat.h:1951
#define V_I1(A)
Definition: oleauto.h:243
#define V_VT(A)
Definition: oleauto.h:211
GLsizei const GLfloat * value
Definition: glext.h:6069

◆ CComVariant() [7/18]

ATL::CComVariant::CComVariant ( BYTE  value)
inline

Definition at line 444 of file atlcomcli.h.

445  {
446  V_VT(this) = VT_UI1;
447  V_UI1(this) = value;
448  }
#define V_UI1(A)
Definition: oleauto.h:266
#define V_VT(A)
Definition: oleauto.h:211
GLsizei const GLfloat * value
Definition: glext.h:6069

◆ CComVariant() [8/18]

ATL::CComVariant::CComVariant ( short  value)
inline

Definition at line 450 of file atlcomcli.h.

451  {
452  V_VT(this) = VT_I2;
453  V_I2(this) = value;
454  }
#define V_I2(A)
Definition: oleauto.h:245
#define V_VT(A)
Definition: oleauto.h:211
GLsizei const GLfloat * value
Definition: glext.h:6069
Definition: compat.h:1938

◆ CComVariant() [9/18]

ATL::CComVariant::CComVariant ( unsigned short  value)
inline

Definition at line 456 of file atlcomcli.h.

457  {
458  V_VT(this) = VT_UI2;
459  V_UI2(this) = value;
460  }
#define V_UI2(A)
Definition: oleauto.h:268
#define V_VT(A)
Definition: oleauto.h:211
GLsizei const GLfloat * value
Definition: glext.h:6069

◆ CComVariant() [10/18]

ATL::CComVariant::CComVariant ( int  value,
VARENUM  type = VT_I4 
)
inline

Definition at line 462 of file atlcomcli.h.

463  {
464  if (type == VT_I4 || type == VT_INT)
465  {
466  V_VT(this) = type;
467  V_I4(this) = value;
468  }
469  else
470  {
471  V_VT(this) = VT_ERROR;
472  V_ERROR(this) = E_INVALIDARG;
473  }
474  }
Definition: compat.h:1939
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define V_I4(A)
Definition: oleauto.h:247
#define E_INVALIDARG
Definition: ddrawi.h:101
#define V_VT(A)
Definition: oleauto.h:211
GLsizei const GLfloat * value
Definition: glext.h:6069
#define V_ERROR(A)
Definition: oleauto.h:241

◆ CComVariant() [11/18]

ATL::CComVariant::CComVariant ( unsigned int  value,
VARENUM  type = VT_UI4 
)
inline

Definition at line 476 of file atlcomcli.h.

477  {
478  if (type == VT_UI4 || type == VT_UINT)
479  {
480  V_VT(this) = type;
481  V_UI4(this) = value;
482  }
483  else
484  {
485  V_VT(this) = VT_ERROR;
486  V_ERROR(this) = E_INVALIDARG;
487  }
488  }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define E_INVALIDARG
Definition: ddrawi.h:101
#define V_UI4(A)
Definition: oleauto.h:270
#define V_VT(A)
Definition: oleauto.h:211
GLsizei const GLfloat * value
Definition: glext.h:6069
#define V_ERROR(A)
Definition: oleauto.h:241

◆ CComVariant() [12/18]

ATL::CComVariant::CComVariant ( long  value,
VARENUM  type = VT_I4 
)
inline

Definition at line 490 of file atlcomcli.h.

491  {
492  if (type == VT_I4 || type == VT_ERROR)
493  {
494  V_VT(this) = type;
495  V_I4(this) = value;
496  }
497  else
498  {
499  V_VT(this) = VT_ERROR;
500  V_ERROR(this) = E_INVALIDARG;
501  }
502  }
Definition: compat.h:1939
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define V_I4(A)
Definition: oleauto.h:247
#define E_INVALIDARG
Definition: ddrawi.h:101
#define V_VT(A)
Definition: oleauto.h:211
GLsizei const GLfloat * value
Definition: glext.h:6069
#define V_ERROR(A)
Definition: oleauto.h:241

◆ CComVariant() [13/18]

ATL::CComVariant::CComVariant ( unsigned long  value)
inline

Definition at line 504 of file atlcomcli.h.

505  {
506  V_VT(this) = VT_UI4;
507  V_UI4(this) = value;
508  }
#define V_UI4(A)
Definition: oleauto.h:270
#define V_VT(A)
Definition: oleauto.h:211
GLsizei const GLfloat * value
Definition: glext.h:6069

◆ CComVariant() [14/18]

ATL::CComVariant::CComVariant ( float  value)
inline

Definition at line 510 of file atlcomcli.h.

511  {
512  V_VT(this) = VT_R4;
513  V_R4(this) = value;
514  }
#define V_R4(A)
Definition: oleauto.h:260
Definition: compat.h:1940
#define V_VT(A)
Definition: oleauto.h:211
GLsizei const GLfloat * value
Definition: glext.h:6069

◆ CComVariant() [15/18]

ATL::CComVariant::CComVariant ( double  value,
VARENUM  type = VT_R8 
)
inline

Definition at line 516 of file atlcomcli.h.

517  {
518  if (type == VT_R8 || type == VT_DATE)
519  {
520  V_VT(this) = type;
521  V_R8(this) = value;
522  }
523  else
524  {
525  V_VT(this) = VT_ERROR;
526  V_ERROR(this) = E_INVALIDARG;
527  }
528  }
#define V_R8(A)
Definition: oleauto.h:262
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define E_INVALIDARG
Definition: ddrawi.h:101
#define V_VT(A)
Definition: oleauto.h:211
GLsizei const GLfloat * value
Definition: glext.h:6069
#define V_ERROR(A)
Definition: oleauto.h:241
Definition: compat.h:1941

◆ CComVariant() [16/18]

ATL::CComVariant::CComVariant ( const LONGLONG value)
inline

Definition at line 530 of file atlcomcli.h.

531  {
532  V_VT(this) = VT_I8;
533  V_I8(this) = value;
534  }
Definition: compat.h:1955
#define V_I8(A)
Definition: oleauto.h:249
#define V_VT(A)
Definition: oleauto.h:211
GLsizei const GLfloat * value
Definition: glext.h:6069

◆ CComVariant() [17/18]

ATL::CComVariant::CComVariant ( const ULONGLONG value)
inline

Definition at line 536 of file atlcomcli.h.

537  {
538  V_VT(this) = VT_UI8;
539  V_UI8(this) = value;
540  }
#define V_UI8(A)
Definition: oleauto.h:272
#define V_VT(A)
Definition: oleauto.h:211
GLsizei const GLfloat * value
Definition: glext.h:6069

◆ CComVariant() [18/18]

ATL::CComVariant::CComVariant ( const CY value)
inline

Definition at line 542 of file atlcomcli.h.

543  {
544  V_VT(this) = VT_CY;
545  V_I8(this) = value.int64;
546  }
#define V_I8(A)
Definition: oleauto.h:249
#define V_VT(A)
Definition: oleauto.h:211
Definition: compat.h:1942

Member Function Documentation

◆ ChangeType()

HRESULT ATL::CComVariant::ChangeType ( _In_ VARTYPE  newType,
_In_opt_ const LPVARIANT  src = NULL 
)
inline

Definition at line 559 of file atlcomcli.h.

560  {
561  const LPVARIANT lpSrc = src ? src : this;
562  return ::VariantChangeType(this, lpSrc, 0, newType);
563  }
HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, USHORT wFlags, VARTYPE vt)
Definition: variant.c:965
GLenum src
Definition: glext.h:6340

Referenced by CShellDispatch::ShellExecute().

◆ Clear()

HRESULT ATL::CComVariant::Clear ( )
inline

Definition at line 549 of file atlcomcli.h.

550  {
551  return ::VariantClear(this);
552  }
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651

Referenced by ~CComVariant().

◆ Copy()

HRESULT ATL::CComVariant::Copy ( _In_ const VARIANT src)
inline

Definition at line 554 of file atlcomcli.h.

555  {
556  return ::VariantCopy(this, const_cast<VARIANT*>(src));
557  }
GLenum src
Definition: glext.h:6340
HRESULT WINAPI VariantCopy(VARIANTARG *pvargDest, VARIANTARG *pvargSrc)
Definition: variant.c:751

Referenced by CComVariant().


The documentation for this class was generated from the following file: