Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

PropVariantToInt16WithDefault function

Extracts the Int16 property value of a PROPVARIANT structure. If no value currently exists, then specified default value is returned.

Syntax


SHORT PropVariantToInt16WithDefault(
  _In_ REFPROPVARIANT propvarIn,
  _In_ SHORT          iDefault
);

Parameters

propvarIn [in]

Type: REFPROPVARIANT

Reference to a source PROPVARIANT structure.

iDefault [in]

Type: SHORT

Specifies default property value, for use where no value currently exists.

Return value

Type: SHORT

Returns the extracted short value, or default.

Remarks

This helper function is used in places where the calling application expects a PROPVARIANT to hold an Int16 value and would like to use a default value if it does not. For instance, an application obtaining values from a property store can use this to safely extract the SHORT value for Int16 properties.

If the source PROPVARIANT has type VT_I2, this helper function extracts the Int16 value. Otherwise, it attempts to convert the value in the PROPVARIANT structure into a SHORT. If the source PROPVARIANT has type VT_EMPTY or a conversion is not possible, then PropVariantToInt16WithDefault will return the default provided by iDefault. See PropVariantChangeType for a list of possible conversions.

Requirements

Minimum supported client

Windows XP with SP2, Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 with SP1 [desktop apps only]

Redistributable

Windows Desktop Search (WDS) 3.0

Header

Propvarutil.h

Library

Propsys.lib

DLL

Propsys.dll (version 6.0 or later)

See also

InitPropVariantFromInt16
PropVariantToInt16
VariantToInt16
PropVariantChangeType

 

 

Community Additions

ADD
Show:
© 2015 Microsoft