Win32 utilities. More...
Go to the source code of this file.
Functions |
|
HRESULT | XSIVariantToCValue (VARIANT *in_Variant, XSI::CValue &out_val) |
HRESULT | XSIVariantFromCValue (const XSI::CValue &in_value, VARIANT *out_var) |
Win32 utilities.
Copyright 2008 Autodesk, Inc. All rights reserved. Use of this software is subject to the terms of the Autodesk license agreement provided at the time of installation or download, or which otherwise accompanies this software in either electronic or hard copy form.
HRESULT XSIVariantToCValue | ( | VARIANT * | in_Variant, |
XSI::CValue & | out_val | ||
) |
Helper to convert from the Win32 VARIANT structure to a CValue. This function is useful for plug-ins which mix the COM and C++ versions of the object model in their implementation.
The VARIANT is the data type used internally by scripting
languages and, like CValue, it can represent many different types,
including strings, objects, integers, doubles and arrays. A VARIANT
containing a BSTR is converted to a CValue containing a CString. A
VARIANT referring to a Softimage COM object is converted to a
CValue containing the equivalent
XSI::CRef object. A VARIANT referencing a SAFEARRAY is
converted to a CValue containing a XSI::CValueArray.
Some uncommon types of VARIANT are not supported, in which case
E_INVALIDARG
is returned.
in_Variant | Variant to convert. It is treated as const. |
out_val | CValue that is equivalent to the Variant. |
HRESULT XSIVariantFromCValue | ( | const XSI::CValue & | in_value, |
VARIANT * | out_var | ||
) |
Helper to convert from CValue to the Win32 VARIANT structure. Normally this routine is not needed because XSI::CComAPIHandler or automatic conversions shield the C++ API user from needing to deal with VARIANTs.
in_value | CValue to convert |
out_var | Address of a VARIANT to fill in based on the CValue's contents. The caller is reponsible for freeing the VARIANT with ::VariantClear(). |