Expand Minimize

InitVariantFromFileTime function

Initializes a VARIANT structure with the contents of a FILETIME structure.

Syntax


HRESULT InitVariantFromFileTime(
  _In_   const FILETIME *pft,
  _Out_  VARIANT *pvar
);

Parameters

pft [in]

Type: const FILETIME*

Pointer to date and time information stored in a FILETIME structure.

pvar [out]

Type: VARIANT*

When this function returns, contains the initialized VARIANT structure.

Return value

Type: HRESULT

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

Remarks

Creates a VT_DATE variant.

Examples

The following example, to be included as part of a larger program, demonstrates how to use InitVariantFromFileTime.


VARIANT var;
FILETIME ft;

GetSystemTimeAsFileTime(&ft);

HRESULT hr = InitVariantFromFileTime(&ft, &var);

if (SUCCEEDED(hr))
{
    // var now is valid and has type VT_DATE.
    VariantClear(&propvar);
}

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

VariantToFileTime
InitPropVariantFromFileTime
GetSystemTimeAsFileTime

 

 

Community Additions

ADD
Show:
© 2014 Microsoft