InitPropVariantFromBuffer Function Home
InitPropVariantFromBuffer Function

Initializes a PROPVARIANT structure using the contents of a buffer.

Syntax

HRESULT InitPropVariantFromBuffer(      
    const void *pv,     UINT cb,     PROPVARIANT *ppropvar );

Parameters

pv
[in] Pointer to the buffer.
cb
[in] The length of the buffer, in bytes.
ppropvar
[out] When this function returns, contains the initialized PROPVARIANT structure.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

Creates a VT_VECTOR | VT_UI1 propvariant.

Example

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

// void *pv;
// UINT cb;
// Assume variable pv and cb are initialized and valid. pv points to a buffer  
// and cb contains the size of the buffer in bytes.
PROPVARIANT propvar;

HRESULT hr = InitPropVariantFromBuffer(pv, cb, &propvar);

if (SUCCEEDED(hr))
{
    // propvar now is valid and has type VT_VECTOR | VT_UI1.
 
    PropVariantClear(&propvar);
}

Function Information

Minimum DLL Versionpropsys.dll version 6.0 or later
Custom ImplementationNo
Headerpropvarutil.h
Import librarypropsys.lib
Minimum operating systems Windows XP Service Pack 2 (SP2) with Windows Desktop Search (WDS) 3.0, Windows Server 2003 Service Pack 1 (SP1) with Windows Desktop Search (WDS) 3.0, Windows Vista

See Also

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View