diff options
Diffstat (limited to 'src/classlibnative/bcltype/oavariant.h')
-rw-r--r-- | src/classlibnative/bcltype/oavariant.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/classlibnative/bcltype/oavariant.h b/src/classlibnative/bcltype/oavariant.h new file mode 100644 index 0000000000..30f7cb1958 --- /dev/null +++ b/src/classlibnative/bcltype/oavariant.h @@ -0,0 +1,46 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// +// File: OAVariant.h +// + +// +// Purpose: Wrapper for Ole Automation compatable math ops. +// Calls through to OleAut.dll +// + +// + +#ifndef _OAVARIANT_H_ +#define _OAVARIANT_H_ + +#ifndef FEATURE_COMINTEROP +#error FEATURE_COMINTEROP is required for this file +#endif // FEATURE_COMINTEROP + +#include "variant.h" + +class COMOAVariant +{ +public: + + // Utility Functions + // Conversion between COM+ variant type field & OleAut Variant enumeration + // WinCE doesn't support Variants entirely. + static VARENUM CVtoVT(const CVTypes cv); + static CVTypes VTtoCV(const VARENUM vt); + + // Conversion between COM+ Variant & OleAut Variant. ToOAVariant + // returns true if the conversion process allocated an object (like a BSTR). + static bool ToOAVariant(const VariantData * const var, VARIANT * oa); + static void FromOAVariant(const VARIANT * const oa, VariantData * const& var); + + // Throw a specific exception for a failure, specified by a given HRESULT. + static void OAFailed(const HRESULT hr); + + static FCDECL6(void, ChangeTypeEx, VariantData *result, VariantData *op, LCID lcid, void *targetType, int cvType, INT16 flags); +}; + + +#endif // _OAVARIANT_H_ |