UID | title | description | helpviewer_keywords | old-location | tech.root | ms.assetid | ms.date | ms.keywords | req.header | req.include-header | req.target-type | req.target-min-winverclnt | req.target-min-winversvr | req.kmdf-ver | req.umdf-ver | req.ddi-compliance | req.unicode-ansi | req.idl | req.max-support | req.namespace | req.assembly | req.type-library | req.lib | req.dll | req.irql | targetos | req.typenames | req.redist | ms.custom | f1_keywords | dev_langs | topic_type | api_type | api_location | api_name | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NF:propvarutil.VariantToDoubleWithDefault |
VariantToDoubleWithDefault function (propvarutil.h) |
Extracts a DOUBLE value from a VARIANT structure. If no value exists, then the specified default value is returned. |
|
properties\VariantToDoubleWithDefault.htm |
properties |
a3e32a30-363d-487e-bdd5-ac2616d6de14 |
12/05/2018 |
VariantToDoubleWithDefault, VariantToDoubleWithDefault function [Windows Properties], _shell_VariantToDoubleWithDefault, properties.VariantToDoubleWithDefault, propvarutil/VariantToDoubleWithDefault, shell.VariantToDoubleWithDefault |
propvarutil.h |
Windows |
Windows XP with SP2, Windows Vista [desktop apps only] |
Windows Server 2003 with SP1 [desktop apps only] |
Propsys.lib |
Propsys.dll (version 6.0 or later) |
Windows |
Windows Desktop Search (WDS) 3.0 |
19H1 |
|
|
|
|
|
|
Extracts a DOUBLE value from a VARIANT structure. If no value exists, then the specified default value is returned.
Type: REFVARIANT
Reference to a source VARIANT structure.
Type: DOUBLE
The default value for use where no extractable value exists.
Type: DOUBLE
Returns the extracted double value; otherwise, the default value specified in dblDefault.
This helper function is used when the calling application expects a VARIANT to hold a DOUBLE value and wants to use a default value if it does not.
If the source VARIANT is of type VT_R8, this helper extracts the DOUBLE value.
If the source VARIANT is not of type VT_R8, the function attempts to convert the value in the VARIANT into a DOUBLE.
If the source VARIANT is of type VT_EMPTY or a conversion is not possible, then VariantToDoubleWithDefault returns the default value provided by dblDefault. See PropVariantChangeType for a list of possible conversions.
The following example, to be included as part of a larger program, demonstrates how to use VariantToDoubleWithDefault to access a DOUBLE value stored in a VARIANT structure.
// VARIANT var;
// Assume variable var is initialized and valid.
// The application expects var to hold a DOUBLE value.
// The application wants to treat VT_EMPTY as 3.1415.
DOUBLE dblValue = VariantToDoubleWithDefault(var, 3.1415);
// dblValue is now valid.