diff options
Diffstat (limited to 'base')
-rw-r--r-- | base/scoped_bstr_win.h | 6 | ||||
-rw-r--r-- | base/scoped_variant_win.cc | 11 | ||||
-rw-r--r-- | base/scoped_variant_win.h | 7 |
3 files changed, 20 insertions, 4 deletions
diff --git a/base/scoped_bstr_win.h b/base/scoped_bstr_win.h index 96979b5..04f27e1 100644 --- a/base/scoped_bstr_win.h +++ b/base/scoped_bstr_win.h @@ -5,13 +5,11 @@ #ifndef BASE_SCOPED_BSTR_WIN_H_ #define BASE_SCOPED_BSTR_WIN_H_ -#include "base/basictypes.h" // needed to pick up OS_WIN - -#include "base/logging.h" - #include <windows.h> #include <oleauto.h> +#include "base/logging.h" + // Manages a BSTR string pointer. // The class interface is based on scoped_ptr. class ScopedBstr { diff --git a/base/scoped_variant_win.cc b/base/scoped_variant_win.cc index 6593a477..dd4bceb 100644 --- a/base/scoped_variant_win.cc +++ b/base/scoped_variant_win.cc @@ -28,6 +28,12 @@ ScopedVariant::ScopedVariant(int value, VARTYPE vt) { var_.lVal = value; } +ScopedVariant::ScopedVariant(double value, VARTYPE vt) { + DCHECK(vt == VT_R8 || vt == VT_DATE); + var_.vt = vt; + var_.dblVal = value; +} + ScopedVariant::ScopedVariant(IDispatch* dispatch) { var_.vt = VT_EMPTY; Set(dispatch); @@ -38,6 +44,11 @@ ScopedVariant::ScopedVariant(IUnknown* unknown) { Set(unknown); } +ScopedVariant::ScopedVariant(SAFEARRAY* safearray) { + var_.vt = VT_EMPTY; + Set(safearray); +} + ScopedVariant::ScopedVariant(const VARIANT& var) { var_.vt = VT_EMPTY; Set(var); diff --git a/base/scoped_variant_win.h b/base/scoped_variant_win.h index 909e4da..4436ca9 100644 --- a/base/scoped_variant_win.h +++ b/base/scoped_variant_win.h @@ -40,12 +40,19 @@ class ScopedVariant { // VARIANT.lVal (32 bit sized field). explicit ScopedVariant(int value, VARTYPE vt = VT_I4); + // Creates a new double-precision type variant. |vt| must be either VT_R8 + // or VT_DATE. + explicit ScopedVariant(double value, VARTYPE vt = VT_R8); + // VT_DISPATCH explicit ScopedVariant(IDispatch* dispatch); // VT_UNKNOWN explicit ScopedVariant(IUnknown* unknown); + // SAFEARRAY + explicit ScopedVariant(SAFEARRAY* safearray); + // Copies the variant. explicit ScopedVariant(const VARIANT& var); |