rlm@1
|
1 // Windows/PropVariant.h
|
rlm@1
|
2
|
rlm@1
|
3 #ifndef __WINDOWS_PROPVARIANT_H
|
rlm@1
|
4 #define __WINDOWS_PROPVARIANT_H
|
rlm@1
|
5
|
rlm@1
|
6 #include "../Common/MyWindows.h"
|
rlm@1
|
7 #include "../Common/Types.h"
|
rlm@1
|
8
|
rlm@1
|
9 namespace NWindows {
|
rlm@1
|
10 namespace NCOM {
|
rlm@1
|
11
|
rlm@1
|
12 class CPropVariant : public tagPROPVARIANT
|
rlm@1
|
13 {
|
rlm@1
|
14 public:
|
rlm@1
|
15 CPropVariant() { vt = VT_EMPTY; wReserved1 = 0; }
|
rlm@1
|
16 ~CPropVariant() { Clear(); }
|
rlm@1
|
17 CPropVariant(const PROPVARIANT& varSrc);
|
rlm@1
|
18 CPropVariant(const CPropVariant& varSrc);
|
rlm@1
|
19 CPropVariant(BSTR bstrSrc);
|
rlm@1
|
20 CPropVariant(LPCOLESTR lpszSrc);
|
rlm@1
|
21 CPropVariant(bool bSrc) { vt = VT_BOOL; wReserved1 = 0; boolVal = (bSrc ? VARIANT_TRUE : VARIANT_FALSE); };
|
rlm@1
|
22 CPropVariant(UInt32 value) { vt = VT_UI4; wReserved1 = 0; ulVal = value; }
|
rlm@1
|
23 CPropVariant(UInt64 value) { vt = VT_UI8; wReserved1 = 0; uhVal = *(ULARGE_INTEGER*)&value; }
|
rlm@1
|
24 CPropVariant(const FILETIME &value) { vt = VT_FILETIME; wReserved1 = 0; filetime = value; }
|
rlm@1
|
25 CPropVariant(Int32 value) { vt = VT_I4; wReserved1 = 0; lVal = value; }
|
rlm@1
|
26 CPropVariant(Byte value) { vt = VT_UI1; wReserved1 = 0; bVal = value; }
|
rlm@1
|
27 CPropVariant(Int16 value) { vt = VT_I2; wReserved1 = 0; iVal = value; }
|
rlm@1
|
28 // CPropVariant(LONG value, VARTYPE vtSrc = VT_I4) { vt = vtSrc; lVal = value; }
|
rlm@1
|
29
|
rlm@1
|
30 CPropVariant& operator=(const CPropVariant& varSrc);
|
rlm@1
|
31 CPropVariant& operator=(const PROPVARIANT& varSrc);
|
rlm@1
|
32 CPropVariant& operator=(BSTR bstrSrc);
|
rlm@1
|
33 CPropVariant& operator=(LPCOLESTR lpszSrc);
|
rlm@1
|
34 CPropVariant& operator=(bool bSrc);
|
rlm@1
|
35 CPropVariant& operator=(UInt32 value);
|
rlm@1
|
36 CPropVariant& operator=(UInt64 value);
|
rlm@1
|
37 CPropVariant& operator=(const FILETIME &value);
|
rlm@1
|
38
|
rlm@1
|
39 CPropVariant& operator=(Int32 value);
|
rlm@1
|
40 CPropVariant& operator=(Byte value);
|
rlm@1
|
41 CPropVariant& operator=(Int16 value);
|
rlm@1
|
42 // CPropVariant& operator=(LONG value);
|
rlm@1
|
43
|
rlm@1
|
44 HRESULT Clear();
|
rlm@1
|
45 HRESULT Copy(const PROPVARIANT* pSrc);
|
rlm@1
|
46 HRESULT Attach(PROPVARIANT* pSrc);
|
rlm@1
|
47 HRESULT Detach(PROPVARIANT* pDest);
|
rlm@1
|
48
|
rlm@1
|
49 HRESULT InternalClear();
|
rlm@1
|
50 void InternalCopy(const PROPVARIANT* pSrc);
|
rlm@1
|
51
|
rlm@1
|
52 int Compare(const CPropVariant &a1);
|
rlm@1
|
53 };
|
rlm@1
|
54
|
rlm@1
|
55 }}
|
rlm@1
|
56
|
rlm@1
|
57 #endif
|