00001 /* 00002 Free Download Manager Copyright (c) 2003-2007 FreeDownloadManager.ORG 00003 */ 00004 00005 #ifndef __WINDOWS_PROPVARIANT_H 00006 #define __WINDOWS_PROPVARIANT_H 00007 00008 #include "MyWindows.h" 00009 #include "Types.h" 00010 00011 namespace NWindows { 00012 namespace NCOM { 00013 00014 class CPropVariant : public tagPROPVARIANT 00015 { 00016 public: 00017 CPropVariant() { vt = VT_EMPTY; } 00018 ~CPropVariant() { Clear(); } 00019 CPropVariant(const PROPVARIANT& varSrc); 00020 CPropVariant(const CPropVariant& varSrc); 00021 CPropVariant(BSTR bstrSrc); 00022 CPropVariant(LPCOLESTR lpszSrc); 00023 CPropVariant(bool bSrc) { vt = VT_BOOL; boolVal = bSrc ? VARIANT_TRUE : VARIANT_FALSE; }; 00024 CPropVariant(UInt32 value) { vt = VT_UI4; ulVal = value; } 00025 CPropVariant(UInt64 value) { vt = VT_UI8; uhVal = *(ULARGE_INTEGER*)&value; } 00026 CPropVariant(const FILETIME &value) { vt = VT_FILETIME; filetime = value; } 00027 CPropVariant(Int32 value) { vt = VT_I4; lVal = value; } 00028 CPropVariant(Byte value) { vt = VT_UI1; bVal = value; } 00029 CPropVariant(Int16 value) { vt = VT_I2; iVal = value; } 00030 00031 00032 CPropVariant& operator=(const CPropVariant& varSrc); 00033 CPropVariant& operator=(const PROPVARIANT& varSrc); 00034 CPropVariant& operator=(BSTR bstrSrc); 00035 CPropVariant& operator=(LPCOLESTR lpszSrc); 00036 CPropVariant& operator=(bool bSrc); 00037 CPropVariant& operator=(UInt32 value); 00038 CPropVariant& operator=(UInt64 value); 00039 CPropVariant& operator=(const FILETIME &value); 00040 00041 CPropVariant& operator=(Int32 value); 00042 CPropVariant& operator=(Byte value); 00043 CPropVariant& operator=(Int16 value); 00044 00045 00046 HRESULT Clear(); 00047 HRESULT Copy(const PROPVARIANT* pSrc); 00048 HRESULT Attach(PROPVARIANT* pSrc); 00049 HRESULT Detach(PROPVARIANT* pDest); 00050 00051 HRESULT InternalClear(); 00052 void InternalCopy(const PROPVARIANT* pSrc); 00053 00054 int Compare(const CPropVariant &a1); 00055 }; 00056 00057 }} 00058 00059 #endif
1.5.6