Scroll to navigation

VarNeg(3w) Wine API VarNeg(3w)

NAME

VarNeg (OLEAUT32.173)

SYNOPSIS

HRESULT VarNeg
(
LPVARIANT pVarIn,
LPVARIANT pVarOut
)
 

DESCRIPTION

Negate the value of a variant.
 

PARAMS

pVarIn [In] Source variant.
pVarOut [Out] Destination for converted value.
 

RETURNS

Success: S_OK. pVarOut contains the converted value.
Failure: An HRESULT error code indicating the error.
 

NOTES

- The type of the value stored in pVarOut depends on the type of pVarIn, according to the following table:
 

Input Type Output Type
 

---------- -----------
 

VT_EMPTY VT_I2
 

VT_UI1 VT_I2
 

VT_BOOL VT_I2
 

VT_BSTR VT_R8
 

All Others Unchanged (unless promoted)
- Where the negated value of a variant does not fit in its base type, the type is promoted according to the following table:
 

Input Type Promoted To
 

---------- -----------
 

VT_I2 VT_I4
 

VT_I4 VT_R8
 

VT_I8 VT_R8
- The native version of this function returns DISP_E_BADVARTYPE for valid variant types that cannot be negated, and returns DISP_E_TYPEMISMATCH for types which are not valid. Since this is in contravention of the meaning of those error codes and unlikely to be relied on by applications, this implementation returns errors consistent with the other high level variant math functions.
 

IMPLEMENTATION

Declared in "oleauto.h".
Implemented in "dlls/oleaut32/variant.c".
Debug channel "variant".
Oct 2012 Wine API