ReactOS 0.4.15-dev-7953-g1f49173
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 430 of file atlcomcli.h.

Constructor & Destructor Documentation

◆ CComVariant() [1/18]

ATL::CComVariant::CComVariant ( )
inline

Definition at line 433 of file atlcomcli.h.

434 {
435 ::VariantInit(this);
436 }
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568

◆ CComVariant() [2/18]

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

Definition at line 438 of file atlcomcli.h.

439 {
440 V_VT(this) = VT_EMPTY;
441 Copy(&other);
442 }
HRESULT Copy(_In_ const VARIANT *src)
Definition: atlcomcli.h:584
@ VT_EMPTY
Definition: compat.h:2295
int other
Definition: msacm.c:1376
#define V_VT(A)
Definition: oleauto.h:211

◆ ~CComVariant()

ATL::CComVariant::~CComVariant ( )
inline

Definition at line 444 of file atlcomcli.h.

445 {
446 Clear();
447 }
HRESULT Clear()
Definition: atlcomcli.h:579

◆ CComVariant() [3/18]

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

Definition at line 449 of file atlcomcli.h.

450 {
451 V_VT(this) = VT_BSTR;
452 V_BSTR(this) = ::SysAllocString(lpStr);
453 }
@ VT_BSTR
Definition: compat.h:2303
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
#define V_BSTR(A)
Definition: oleauto.h:226

◆ CComVariant() [4/18]

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

Definition at line 455 of file atlcomcli.h.

456 {
457 V_VT(this) = VT_BSTR;
458 CComBSTR str(lpStr);
459 V_BSTR(this) = str.Detach();
460 }
const WCHAR * str

◆ CComVariant() [5/18]

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

Definition at line 462 of file atlcomcli.h.

463 {
464 V_VT(this) = VT_BOOL;
465 V_BOOL(this) = value ? VARIANT_TRUE : VARIANT_FALSE;
466 }
@ VT_BOOL
Definition: compat.h:2306
#define V_BOOL(A)
Definition: oleauto.h:224
Definition: pdh_main.c:94

◆ CComVariant() [6/18]

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

Definition at line 468 of file atlcomcli.h.

469 {
470 V_VT(this) = VT_I1;
471 V_I1(this) = value;
472 }
@ VT_I1
Definition: compat.h:2310
#define V_I1(A)
Definition: oleauto.h:243

◆ CComVariant() [7/18]

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

Definition at line 474 of file atlcomcli.h.

475 {
476 V_VT(this) = VT_UI1;
477 V_UI1(this) = value;
478 }
@ VT_UI1
Definition: compat.h:2311
#define V_UI1(A)
Definition: oleauto.h:266

◆ CComVariant() [8/18]

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

Definition at line 480 of file atlcomcli.h.

481 {
482 V_VT(this) = VT_I2;
483 V_I2(this) = value;
484 }
@ VT_I2
Definition: compat.h:2297
#define V_I2(A)
Definition: oleauto.h:245

◆ CComVariant() [9/18]

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

Definition at line 486 of file atlcomcli.h.

487 {
488 V_VT(this) = VT_UI2;
489 V_UI2(this) = value;
490 }
@ VT_UI2
Definition: compat.h:2312
#define V_UI2(A)
Definition: oleauto.h:268

◆ CComVariant() [10/18]

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

Definition at line 492 of file atlcomcli.h.

493 {
494 if (type == VT_I4 || type == VT_INT)
495 {
496 V_VT(this) = type;
497 V_I4(this) = value;
498 }
499 else
500 {
501 V_VT(this) = VT_ERROR;
502 V_ERROR(this) = E_INVALIDARG;
503 }
504 }
#define E_INVALIDARG
Definition: ddrawi.h:101
@ VT_INT
Definition: compat.h:2316
@ VT_ERROR
Definition: compat.h:2305
@ VT_I4
Definition: compat.h:2298
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define V_ERROR(A)
Definition: oleauto.h:241
#define V_I4(A)
Definition: oleauto.h:247

◆ CComVariant() [11/18]

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

Definition at line 506 of file atlcomcli.h.

507 {
508 if (type == VT_UI4 || type == VT_UINT)
509 {
510 V_VT(this) = type;
511 V_UI4(this) = value;
512 }
513 else
514 {
515 V_VT(this) = VT_ERROR;
516 V_ERROR(this) = E_INVALIDARG;
517 }
518 }
@ VT_UI4
Definition: compat.h:2313
@ VT_UINT
Definition: compat.h:2317
#define V_UI4(A)
Definition: oleauto.h:270

◆ CComVariant() [12/18]

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

Definition at line 520 of file atlcomcli.h.

521 {
522 if (type == VT_I4 || type == VT_ERROR)
523 {
524 V_VT(this) = type;
525 V_I4(this) = value;
526 }
527 else
528 {
529 V_VT(this) = VT_ERROR;
530 V_ERROR(this) = E_INVALIDARG;
531 }
532 }

◆ CComVariant() [13/18]

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

Definition at line 534 of file atlcomcli.h.

535 {
536 V_VT(this) = VT_UI4;
537 V_UI4(this) = value;
538 }

◆ CComVariant() [14/18]

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

Definition at line 540 of file atlcomcli.h.

541 {
542 V_VT(this) = VT_R4;
543 V_R4(this) = value;
544 }
@ VT_R4
Definition: compat.h:2299
#define V_R4(A)
Definition: oleauto.h:260

◆ CComVariant() [15/18]

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

Definition at line 546 of file atlcomcli.h.

547 {
548 if (type == VT_R8 || type == VT_DATE)
549 {
550 V_VT(this) = type;
551 V_R8(this) = value;
552 }
553 else
554 {
555 V_VT(this) = VT_ERROR;
556 V_ERROR(this) = E_INVALIDARG;
557 }
558 }
@ VT_R8
Definition: compat.h:2300
@ VT_DATE
Definition: compat.h:2302
#define V_R8(A)
Definition: oleauto.h:262

◆ CComVariant() [16/18]

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

Definition at line 560 of file atlcomcli.h.

561 {
562 V_VT(this) = VT_I8;
563 V_I8(this) = value;
564 }
@ VT_I8
Definition: compat.h:2314
#define V_I8(A)
Definition: oleauto.h:249

◆ CComVariant() [17/18]

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

Definition at line 566 of file atlcomcli.h.

567 {
568 V_VT(this) = VT_UI8;
569 V_UI8(this) = value;
570 }
@ VT_UI8
Definition: compat.h:2315
#define V_UI8(A)
Definition: oleauto.h:272

◆ CComVariant() [18/18]

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

Definition at line 572 of file atlcomcli.h.

573 {
574 V_VT(this) = VT_CY;
575 V_I8(this) = value.int64;
576 }
@ VT_CY
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 589 of file atlcomcli.h.

590 {
591 const LPVARIANT lpSrc = src ? src : this;
592 return ::VariantChangeType(this, lpSrc, 0, newType);
593 }
GLenum src
Definition: glext.h:6340

Referenced by CShellDispatch::ShellExecute().

◆ Clear()

HRESULT ATL::CComVariant::Clear ( )
inline

Definition at line 579 of file atlcomcli.h.

580 {
581 return ::VariantClear(this);
582 }

Referenced by ~CComVariant().

◆ Copy()

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

Definition at line 584 of file atlcomcli.h.

585 {
586 return ::VariantCopy(this, const_cast<VARIANT*>(src));
587 }

Referenced by CComVariant(), and CMemPropertyBag::Write().


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