ReactOS  0.4.15-dev-5492-g47f3a4e
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 407 of file atlcomcli.h.

Constructor & Destructor Documentation

◆ CComVariant() [1/18]

ATL::CComVariant::CComVariant ( )
inline

Definition at line 410 of file atlcomcli.h.

411  {
412  ::VariantInit(this);
413  }
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568

◆ CComVariant() [2/18]

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

Definition at line 415 of file atlcomcli.h.

416  {
417  V_VT(this) = VT_EMPTY;
418  Copy(&other);
419  }
int other
Definition: msacm.c:1376
#define V_VT(A)
Definition: oleauto.h:211
HRESULT Copy(_In_ const VARIANT *src)
Definition: atlcomcli.h:561

◆ ~CComVariant()

ATL::CComVariant::~CComVariant ( )
inline

Definition at line 421 of file atlcomcli.h.

422  {
423  Clear();
424  }
HRESULT Clear()
Definition: atlcomcli.h:556

◆ CComVariant() [3/18]

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

Definition at line 426 of file atlcomcli.h.

427  {
428  V_VT(this) = VT_BSTR;
429  V_BSTR(this) = ::SysAllocString(lpStr);
430  }
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
#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 432 of file atlcomcli.h.

433  {
434  V_VT(this) = VT_BSTR;
435  CComBSTR str(lpStr);
436  V_BSTR(this) = str.Detach();
437  }
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 439 of file atlcomcli.h.

440  {
441  V_VT(this) = VT_BOOL;
442  V_BOOL(this) = value ? VARIANT_TRUE : VARIANT_FALSE;
443  }
Definition: pdh_main.c:93
#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 445 of file atlcomcli.h.

446  {
447  V_VT(this) = VT_I1;
448  V_I1(this) = value;
449  }
Definition: compat.h:2310
#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 451 of file atlcomcli.h.

452  {
453  V_VT(this) = VT_UI1;
454  V_UI1(this) = value;
455  }
#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 457 of file atlcomcli.h.

458  {
459  V_VT(this) = VT_I2;
460  V_I2(this) = value;
461  }
#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:2297

◆ CComVariant() [9/18]

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

Definition at line 463 of file atlcomcli.h.

464  {
465  V_VT(this) = VT_UI2;
466  V_UI2(this) = value;
467  }
#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 469 of file atlcomcli.h.

470  {
471  if (type == VT_I4 || type == VT_INT)
472  {
473  V_VT(this) = type;
474  V_I4(this) = value;
475  }
476  else
477  {
478  V_VT(this) = VT_ERROR;
479  V_ERROR(this) = E_INVALIDARG;
480  }
481  }
Definition: compat.h:2298
#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
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

◆ CComVariant() [11/18]

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

Definition at line 483 of file atlcomcli.h.

484  {
485  if (type == VT_UI4 || type == VT_UINT)
486  {
487  V_VT(this) = type;
488  V_UI4(this) = value;
489  }
490  else
491  {
492  V_VT(this) = VT_ERROR;
493  V_ERROR(this) = E_INVALIDARG;
494  }
495  }
#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
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

◆ CComVariant() [12/18]

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

Definition at line 497 of file atlcomcli.h.

498  {
499  if (type == VT_I4 || type == VT_ERROR)
500  {
501  V_VT(this) = type;
502  V_I4(this) = value;
503  }
504  else
505  {
506  V_VT(this) = VT_ERROR;
507  V_ERROR(this) = E_INVALIDARG;
508  }
509  }
Definition: compat.h:2298
#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
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

◆ CComVariant() [13/18]

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

Definition at line 511 of file atlcomcli.h.

512  {
513  V_VT(this) = VT_UI4;
514  V_UI4(this) = value;
515  }
#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 517 of file atlcomcli.h.

518  {
519  V_VT(this) = VT_R4;
520  V_R4(this) = value;
521  }
#define V_R4(A)
Definition: oleauto.h:260
Definition: compat.h:2299
#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 523 of file atlcomcli.h.

524  {
525  if (type == VT_R8 || type == VT_DATE)
526  {
527  V_VT(this) = type;
528  V_R8(this) = value;
529  }
530  else
531  {
532  V_VT(this) = VT_ERROR;
533  V_ERROR(this) = E_INVALIDARG;
534  }
535  }
#define V_R8(A)
Definition: oleauto.h:262
#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
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
Definition: compat.h:2300

◆ CComVariant() [16/18]

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

Definition at line 537 of file atlcomcli.h.

538  {
539  V_VT(this) = VT_I8;
540  V_I8(this) = value;
541  }
Definition: compat.h:2314
#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 543 of file atlcomcli.h.

544  {
545  V_VT(this) = VT_UI8;
546  V_UI8(this) = value;
547  }
#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 549 of file atlcomcli.h.

550  {
551  V_VT(this) = VT_CY;
552  V_I8(this) = value.int64;
553  }
Definition: pdh_main.c:93
#define V_I8(A)
Definition: oleauto.h:249
#define V_VT(A)
Definition: oleauto.h:211
Definition: compat.h:2301

Member Function Documentation

◆ ChangeType()

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

Definition at line 566 of file atlcomcli.h.

567  {
568  const LPVARIANT lpSrc = src ? src : this;
569  return ::VariantChangeType(this, lpSrc, 0, newType);
570  }
HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, USHORT wFlags, VARTYPE vt)
Definition: variant.c:962
GLenum src
Definition: glext.h:6340

Referenced by CShellDispatch::ShellExecute().

◆ Clear()

HRESULT ATL::CComVariant::Clear ( )
inline

Definition at line 556 of file atlcomcli.h.

557  {
558  return ::VariantClear(this);
559  }
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648

Referenced by ~CComVariant().

◆ Copy()

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

Definition at line 561 of file atlcomcli.h.

562  {
563  return ::VariantCopy(this, const_cast<VARIANT*>(src));
564  }
GLenum src
Definition: glext.h:6340
HRESULT WINAPI VariantCopy(VARIANTARG *pvargDest, VARIANTARG *pvargSrc)
Definition: variant.c:748

Referenced by CComVariant().


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