Compartilhar via


IPropertyStore::GetCount method

Gets the number of properties attached to the file.

Syntax

HRESULT GetCount(
  [out] DWORD *cProps
);

Parameters

  • cProps [out]
    Type: DWORD*

    When this method returns, contains the property count.

Return value

Type: HRESULT

IPropertyStore::GetCount returns S_OK on success, even if the file has no properties.

Remarks

IPropertyStore provides an abstraction over an array of property keys via the IPropertyStore::GetCount and IPropertyStore::GetAt methods. The property keys in this array represent the properties currently stored by the IPropertyStore.

When GetCount succeeds, the value pointed to by pcProps is a count of property keys in the array. The caller can expect calls to IPropertyStore::GetAt to succeed for values of iProp less than pcProps.

Calling applicatons: GetCount and GetAt may not return the full set of properties that are supported by a particular property store. In some cases, the property store is capable of storing any property key, and thus only enumerates the keys already in the store. Some callers may find property lists useful for determining a list of properties that users find useful for a particular file type.

Implementers: In the case of failures such as E_OUTOFMEMORY, you should set cProps to zero. It is preferable that errors are discovered during creation or initialization of the property store.

Requirements

Minimum supported client

Windows Vista [desktop apps | UWP apps]

Minimum supported server

Windows Server 2008 [desktop apps | UWP apps]

Header

Propsys.h

IDL

Propsys.idl