ReactOS  0.4.12-dev-51-ge94618b
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 394 of file atlcomcli.h.

Constructor & Destructor Documentation

◆ CComVariant() [1/18]

ATL::CComVariant::CComVariant ( )
inline

Definition at line 397 of file atlcomcli.h.

398  {
399  ::VariantInit(this);
400  }
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571

◆ CComVariant() [2/18]

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

Definition at line 402 of file atlcomcli.h.

403  {
404  V_VT(this) = VT_EMPTY;
405  Copy(&other);
406  }
#define V_VT(A)
Definition: oleauto.h:211
HRESULT Copy(_In_ const VARIANT *src)
Definition: atlcomcli.h:548

◆ ~CComVariant()

ATL::CComVariant::~CComVariant ( )
inline

Definition at line 408 of file atlcomcli.h.

409  {
410  Clear();
411  }
HRESULT Clear()
Definition: atlcomcli.h:543

◆ CComVariant() [3/18]

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

Definition at line 413 of file atlcomcli.h.

414  {
415  V_VT(this) = VT_BSTR;
416  V_BSTR(this) = ::SysAllocString(lpStr);
417  }
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:242
#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 419 of file atlcomcli.h.

420  {
421  V_VT(this) = VT_BSTR;
422  CComBSTR str(lpStr);
423  V_BSTR(this) = str.Detach();
424  }
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 426 of file atlcomcli.h.

427  {
428  V_VT(this) = VT_BOOL;
429  V_BOOL(this) = value ? VARIANT_TRUE : VARIANT_FALSE;
430  }
Definition: get.c:139
#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 432 of file atlcomcli.h.

433  {
434  V_VT(this) = VT_I1;
435  V_I1(this) = value;
436  }
Definition: compat.h:1944
#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 438 of file atlcomcli.h.

439  {
440  V_VT(this) = VT_UI1;
441  V_UI1(this) = value;
442  }
#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 444 of file atlcomcli.h.

445  {
446  V_VT(this) = VT_I2;
447  V_I2(this) = value;
448  }
#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:1931

◆ CComVariant() [9/18]

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

Definition at line 450 of file atlcomcli.h.

451  {
452  V_VT(this) = VT_UI2;
453  V_UI2(this) = value;
454  }
#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 456 of file atlcomcli.h.

457  {
458  if (type == VT_I4 || type == VT_INT)
459  {
460  V_VT(this) = type;
461  V_I4(this) = value;
462  }
463  else
464  {
465  V_VT(this) = VT_ERROR;
466  V_ERROR(this) = E_INVALIDARG;
467  }
468  }
Definition: compat.h:1932
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 470 of file atlcomcli.h.

471  {
472  if (type == VT_UI4 || type == VT_UINT)
473  {
474  V_VT(this) = type;
475  V_UI4(this) = value;
476  }
477  else
478  {
479  V_VT(this) = VT_ERROR;
480  V_ERROR(this) = E_INVALIDARG;
481  }
482  }
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 484 of file atlcomcli.h.

485  {
486  if (type == VT_I4 || type == VT_ERROR)
487  {
488  V_VT(this) = type;
489  V_I4(this) = value;
490  }
491  else
492  {
493  V_VT(this) = VT_ERROR;
494  V_ERROR(this) = E_INVALIDARG;
495  }
496  }
Definition: compat.h:1932
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 498 of file atlcomcli.h.

499  {
500  V_VT(this) = VT_UI4;
501  V_UI4(this) = value;
502  }
#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 504 of file atlcomcli.h.

505  {
506  V_VT(this) = VT_R4;
507  V_R4(this) = value;
508  }
#define V_R4(A)
Definition: oleauto.h:260
Definition: compat.h:1933
#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 510 of file atlcomcli.h.

511  {
512  if (type == VT_R8 || type == VT_DATE)
513  {
514  V_VT(this) = type;
515  V_R8(this) = value;
516  }
517  else
518  {
519  V_VT(this) = VT_ERROR;
520  V_ERROR(this) = E_INVALIDARG;
521  }
522  }
#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:1934

◆ CComVariant() [16/18]

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

Definition at line 524 of file atlcomcli.h.

525  {
526  V_VT(this) = VT_I8;
527  V_I8(this) = value;
528  }
Definition: compat.h:1948
#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 530 of file atlcomcli.h.

531  {
532  V_VT(this) = VT_UI8;
533  V_UI8(this) = value;
534  }
#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 536 of file atlcomcli.h.

537  {
538  V_VT(this) = VT_CY;
539  V_I8(this) = value.int64;
540  }
#define V_I8(A)
Definition: oleauto.h:249
LONGLONG int64
Definition: compat.h:1899
#define V_VT(A)
Definition: oleauto.h:211
Definition: compat.h:1935

Member Function Documentation

◆ ChangeType()

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

Definition at line 553 of file atlcomcli.h.

Referenced by CShellDispatch::ShellExecute().

554  {
555  const LPVARIANT lpSrc = src ? src : this;
556  return ::VariantChangeType(this, lpSrc, 0, newType);
557  }
HRESULT WINAPI VariantChangeType(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, USHORT wFlags, VARTYPE vt)
Definition: variant.c:965
GLuint const GLubyte GLvoid * src
Definition: s_context.h:57

◆ Clear()

HRESULT ATL::CComVariant::Clear ( )
inline

Definition at line 543 of file atlcomcli.h.

544  {
545  return ::VariantClear(this);
546  }
HRESULT WINAPI VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651

◆ Copy()

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

Definition at line 548 of file atlcomcli.h.

549  {
550  return ::VariantCopy(this, const_cast<VARIANT*>(src));
551  }
GLuint const GLubyte GLvoid * src
Definition: s_context.h:57
HRESULT WINAPI VariantCopy(VARIANTARG *pvargDest, VARIANTARG *pvargSrc)
Definition: variant.c:751

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