VarAdd function

Returns the sum of two variants.

Syntax

HRESULT VarAdd(
  LPVARIANT pvarLeft,
  LPVARIANT pvarRight,
  LPVARIANT pvarResult
);

Parameters

pvarLeft

The first variant.

pvarRight

The second variant.

pvarResult

The result variant.

Return Value

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The function operates as follows.

Condition Result
Both expressions are strings Concatenated
One expression is a string and the other a character Addition
One expression is numeric and the other a string Addition
Both expressions are numeric Addition
Either expression is null Null
Both expressions are empty Integer

Requirements

   
Target Platform Windows
Header oleauto.h
Library OleAut32.lib
DLL OleAut32.dll