Editare

Partajați prin


CMFCFilterChunkValueImpl Class

This is a class which simplifies both chunk and property value pair logic.

Syntax

class CMFCFilterChunkValueImpl : public ATL::IFilterChunkValue;

Members

Public Constructors

Name Description
CMFCFilterChunkValueImpl::~CMFCFilterChunkValueImpl Destructs the object.
CMFCFilterChunkValueImpl::CMFCFilterChunkValueImpl Constructs the object.

Public Methods

Name Description
CMFCFilterChunkValueImpl::Clear Clears the ChunkValue.
CMFCFilterChunkValueImpl::CopyChunk Copies this chunk to a structure describing the characteristics of a chunk.
CMFCFilterChunkValueImpl::CopyFrom Initializes this chunk value from the other value.
CMFCFilterChunkValueImpl::GetChunkGUID Retrieves the chunk GUID.
CMFCFilterChunkValueImpl::GetChunkPID Retrieves the chunk PID (property ID).
CMFCFilterChunkValueImpl::GetChunkType Gets chunk type.
CMFCFilterChunkValueImpl::GetString Retrieves the string value.
CMFCFilterChunkValueImpl::GetValue Retrieves the value as an allocated propvariant.
CMFCFilterChunkValueImpl::GetValueNoAlloc Returns non-allocated (internal value) value.
CMFCFilterChunkValueImpl::IsValid Checks whether this property value is valid or not.
CMFCFilterChunkValueImpl::SetBoolValue Overloaded. Sets the property by key to a Boolean.
CMFCFilterChunkValueImpl::SetDwordValue Sets the property by key to a DWORD.
CMFCFilterChunkValueImpl::SetFileTimeValue Sets the property by key to a filetime.
CMFCFilterChunkValueImpl::SetInt64Value Sets the property by key to an int64.
CMFCFilterChunkValueImpl::SetIntValue Sets the property by key to an int.
CMFCFilterChunkValueImpl::SetLongValue Sets the property by key to a LONG.
CMFCFilterChunkValueImpl::SetSystemTimeValue Sets the property by key to a SystemTime.
CMFCFilterChunkValueImpl::SetTextValue Sets the property by key to a Unicode string.

Protected Methods

Name Description
CMFCFilterChunkValueImpl::SetChunk A helper function that sets the chunk's common properties.

Remarks

To use, you simply create a CMFCFilterChunkValueImpl class of the right kind

Example:

CMFCFilterChunkValueImpl chunk;

hr = chunk.SetBoolValue(PKEY_IsAttachment, true);

or

hr = chunk.SetFileTimeValue(PKEY_ItemDate, ftLastModified);

Inheritance Hierarchy

ATL::IFilterChunkValue

CMFCFilterChunkValueImpl

Requirements

Header: afxwin.h

CMFCFilterChunkValueImpl::Clear

Clears the ChunkValue.

void Clear();

Remarks

CMFCFilterChunkValueImpl::CMFCFilterChunkValueImpl

Constructs the object.

CMFCFilterChunkValueImpl();

Remarks

CMFCFilterChunkValueImpl::~CMFCFilterChunkValueImpl

Destructs the object.

virtual ~CMFCFilterChunkValueImpl();

Remarks

CMFCFilterChunkValueImpl::CopyChunk

Copies this chunk to a structure describing the characteristics of a chunk.

HRESULT CopyChunk(STAT_CHUNK* pStatChunk);

Parameters

pStatChunk
A pointer to destination value describing the characteristics of the chunk.

Return Value

S_OK if successful; otherwise an error code.

Remarks

CMFCFilterChunkValueImpl::CopyFrom

Initializes this chunk value from the other value.

void CopyFrom (IFilterChunkValue* pValue);

Parameters

pValue
Specifies the source value to copy from.

Remarks

CMFCFilterChunkValueImpl::GetChunkGUID

Retrieves the chunk GUID.

REFGUID GetChunkGUID() const;

Return Value

A reference to a GUID identifying the chunk.

Remarks

CMFCFilterChunkValueImpl::GetChunkPID

Retrieves the chunk PID (property ID).

DWORD GetChunkPID() const;

Return Value

A DWORD value containing the property ID.

Remarks

CMFCFilterChunkValueImpl::GetChunkType

Retrieves the chunk type.

CHUNKSTATE GetChunkType() const;

Return Value

A CHUNKSTATE enumerated value, which specifies whether the current chunk is a text-type property or a value-type property.

Remarks

CMFCFilterChunkValueImpl::GetString

Retrieves the string value.

CString &GetString();

Return Value

A string containing the chunk value.

Remarks

CMFCFilterChunkValueImpl::GetValue

Retrieves the value as an allocated propvariant.

HRESULT GetValue(PROPVARIANT** ppPropVariant);

Parameters

ppPropVariant
When the function returns, this parameter contains the chunk value.

Return Value

S_OK if PROPVARIANT was allocated successfully and the chunk value was successfully copied to ppPropVariant; otherwise an error code.

Remarks

CMFCFilterChunkValueImpl::GetValueNoAlloc

Returns the non-allocated (internal value) value.

PROPVARIANT GetValueNoAlloc ();

Return Value

Returns the current chunk value.

Remarks

CMFCFilterChunkValueImpl::IsValid

Checks whether this property value is valid or not.

BOOL IsValid() const;

Return Value

TRUE if the current chunk value is valid; otherwise FALSE.

Remarks

CMFCFilterChunkValueImpl::SetBoolValue

Overloaded. Sets the property by key to a Boolean.

HRESULT SetBoolValue(
    REFPROPERTYKEY pkey,
    BOOL bVal,
    CHUNKSTATE chunkType = CHUNK_VALUE,
    LCID locale = 0,
    DWORD cwcLenSource = 0,
    DWORD cwcStartSource = 0,
    CHUNK_BREAKTYPE chunkBreakType = CHUNK_NO_BREAK);

HRESULT SetBoolValue(
    REFPROPERTYKEY pkey,
    VARIANT_BOOL bVal,
    CHUNKSTATE chunkType = CHUNK_VALUE,
    LCID locale = 0,
    DWORD cwcLenSource = 0,
    DWORD cwcStartSource = 0,
    CHUNK_BREAKTYPE chunkBreakType = CHUNK_NO_BREAK);

Parameters

pkey
Specifies a property key.

bVal
Specifies the chunk value to set.

chunkType
Flags indicate whether this chunk contains a text-type or a value-type property. Flag values are taken from the CHUNKSTATE enumeration.

locale
The language and sublanguage associated with a chunk of text. Chunk locale is used by document indexers to perform proper word breaking of text. If the chunk is neither text-type nor a value-type with data type VT_LPWSTR, VT_LPSTR, or VT_BSTR, this field is ignored.

cwcLenSource
The length in characters of the source text from which the current chunk was derived. A zero value signifies character-by-character correspondence between the source text and the derived text. A nonzero value means that no such direct correspondence exists.

cwcStartSource
The offset from which the source text for a derived chunk starts in the source chunk.

chunkBreakType
The type of break that separates the previous chunk from the current chunk. Values are from the CHUNK_BREAKTYPE enumeration.

Return Value

S_OK if successful; otherwise an error code.

Remarks

CMFCFilterChunkValueImpl::SetChunk

A helper function that sets the chunk's common properties.

HRESULT SetChunk(
    REFPROPERTYKEY pkey,
    CHUNKSTATE chunkType=CHUNK_VALUE,
    LCID locale=0,
    DWORD cwcLenSource=0,
    DWORD cwcStartSource=0,
    CHUNK_BREAKTYPE chunkBreakType=CHUNK_NO_BREAK);

Parameters

pkey
Specifies a property key.

chunkType
Flags indicate whether this chunk contains a text-type or a value-type property. Flag values are taken from the CHUNKSTATE enumeration.

locale
The language and sublanguage associated with a chunk of text. Chunk locale is used by document indexers to perform proper word breaking of text. If the chunk is neither text-type nor a value-type with data type VT_LPWSTR, VT_LPSTR, or VT_BSTR, this field is ignored.

cwcLenSource
The length in characters of the source text from which the current chunk was derived. A zero value signifies character-by-character correspondence between the source text and the derived text. A nonzero value means that no such direct correspondence exists.

cwcStartSource
The offset from which the source text for a derived chunk starts in the source chunk.

chunkBreakType
The type of break that separates the previous chunk from the current chunk. Values are from the CHUNK_BREAKTYPE enumeration.

Return Value

S_OK if successful; otherwise error code.

Remarks

CMFCFilterChunkValueImpl::SetDwordValue

Set the property by key to a DWORD.

HRESULT SetDwordValue(
    REFPROPERTYKEY pkey,
    DWORD dwVal,
    CHUNKSTATE chunkType = CHUNK_VALUE,
    LCID locale = 0,
    DWORD cwcLenSource = 0,
    DWORD cwcStartSource = 0,
    CHUNK_BREAKTYPE chunkBreakType = CHUNK_NO_BREAK);

Parameters

pkey
Specifies a property key.

dwVal
Specifies the chunk value to set.

chunkType
Flags indicate whether this chunk contains a text-type or a value-type property. Flag values are taken from the CHUNKSTATE enumeration.

locale
The language and sublanguage associated with a chunk of text. Chunk locale is used by document indexers to perform proper word breaking of text. If the chunk is neither text-type nor a value-type with data type VT_LPWSTR, VT_LPSTR, or VT_BSTR, this field is ignored.

cwcLenSource
The length in characters of the source text from which the current chunk was derived. A zero value signifies character-by-character correspondence between the source text and the derived text. A nonzero value means that no such direct correspondence exists.

cwcStartSource
The offset from which the source text for a derived chunk starts in the source chunk.

chunkBreakType
The type of break that separates the previous chunk from the current chunk. Values are from the CHUNK_BREAKTYPE enumeration.

Return Value

S_OK if successful; otherwise an error code.

Remarks

CMFCFilterChunkValueImpl::SetFileTimeValue

Set the property by key to a filetime.

HRESULT SetFileTimeValue(
    REFPROPERTYKEY pkey,
    FILETIME dtVal,
    CHUNKSTATE chunkType = CHUNK_VALUE,
    LCID locale = 0,
    DWORD cwcLenSource = 0,
    DWORD cwcStartSource = 0,
    CHUNK_BREAKTYPE chunkBreakType = CHUNK_NO_BREAK);

Parameters

pkey
Specifies a property key.

dtVal
Specifies the chunk value to set.

chunkType
Flags indicate whether this chunk contains a text-type or a value-type property. Flag values are taken from the CHUNKSTATE enumeration.

locale
The language and sublanguage associated with a chunk of text. Chunk locale is used by document indexers to perform proper word breaking of text. If the chunk is neither text-type nor a value-type with data type VT_LPWSTR, VT_LPSTR, or VT_BSTR, this field is ignored.

cwcLenSource
The length in characters of the source text from which the current chunk was derived. A zero value signifies character-by-character correspondence between the source text and the derived text. A nonzero value means that no such direct correspondence exists.

cwcStartSource
The offset from which the source text for a derived chunk starts in the source chunk.

chunkBreakType
The type of break that separates the previous chunk from the current chunk. Values are from the CHUNK_BREAKTYPE enumeration.

Return Value

S_OK if successful; otherwise an error code.

Remarks

CMFCFilterChunkValueImpl::SetInt64Value

Set the property by key to an int64.

HRESULT SetInt64Value(
    REFPROPERTYKEY pkey,
    __int64 nVal,
    CHUNKSTATE chunkType = CHUNK_VALUE,
    LCID locale = 0,
    DWORD cwcLenSource = 0,
    DWORD cwcStartSource = 0,
    CHUNK_BREAKTYPE chunkBreakType = CHUNK_NO_BREAK);

Parameters

pkey
Specifies a property key.

nVal
Specifies the chunk value to set.

chunkType
Flags indicate whether this chunk contains a text-type or a value-type property. Flag values are taken from the CHUNKSTATE enumeration.

locale
The language and sublanguage associated with a chunk of text. Chunk locale is used by document indexers to perform proper word breaking of text. If the chunk is neither text-type nor a value-type with data type VT_LPWSTR, VT_LPSTR, or VT_BSTR, this field is ignored.

cwcLenSource
The length in characters of the source text from which the current chunk was derived. A zero value signifies character-by-character correspondence between the source text and the derived text. A nonzero value means that no such direct correspondence exists.

cwcStartSource
The offset from which the source text for a derived chunk starts in the source chunk.

chunkBreakType
The type of break that separates the previous chunk from the current chunk. Values are from the CHUNK_BREAKTYPE enumeration.

Return Value

S_OK if successful; otherwise an error code.

Remarks

CMFCFilterChunkValueImpl::SetIntValue

Set the property by key to an int.

HRESULT SetIntValue(
    REFPROPERTYKEY pkey,
    int nVal,
    CHUNKSTATE chunkType = CHUNK_VALUE,
    LCID locale = 0,
    DWORD cwcLenSource = 0,
    DWORD cwcStartSource = 0,
    CHUNK_BREAKTYPE chunkBreakType = CHUNK_NO_BREAK);

Parameters

pkey
Specifies a property key.

nVal
Specifies the chunk value to set.

chunkType
Flags indicate whether this chunk contains a text-type or a value-type property. Flag values are taken from the CHUNKSTATE enumeration.

locale
The language and sublanguage associated with a chunk of text. Chunk locale is used by document indexers to perform proper word breaking of text. If the chunk is neither text-type nor a value-type with data type VT_LPWSTR, VT_LPSTR, or VT_BSTR, this field is ignored.

cwcLenSource
The length in characters of the source text from which the current chunk was derived. A zero value signifies character-by-character correspondence between the source text and the derived text. A nonzero value means that no such direct correspondence exists.

cwcStartSource
The offset from which the source text for a derived chunk starts in the source chunk.

chunkBreakType
The type of break that separates the previous chunk from the current chunk. Values are from the CHUNK_BREAKTYPE enumeration.

Return Value

S_OK if successful; otherwise an error code.

Remarks

CMFCFilterChunkValueImpl::SetLongValue

Set the property by key to a LONG.

HRESULT SetLongValue(
    REFPROPERTYKEY pkey,
    long lVal,
    CHUNKSTATE chunkType = CHUNK_VALUE,
    LCID locale = 0,
    DWORD cwcLenSource = 0,
    DWORD cwcStartSource = 0,
    CHUNK_BREAKTYPE chunkBreakType = CHUNK_NO_BREAK);

Parameters

pkey
Specifies a property key.

lVal
Specifies the chunk value to set.

chunkType
Flags indicate whether this chunk contains a text-type or a value-type property. Flag values are taken from the CHUNKSTATE enumeration.

locale
The language and sublanguage associated with a chunk of text. Chunk locale is used by document indexers to perform proper word breaking of text. If the chunk is neither text-type nor a value-type with data type VT_LPWSTR, VT_LPSTR, or VT_BSTR, this field is ignored.

cwcLenSource
The length in characters of the source text from which the current chunk was derived. A zero value signifies character-by-character correspondence between the source text and the derived text. A nonzero value means that no such direct correspondence exists.

cwcStartSource
The offset from which the source text for a derived chunk starts in the source chunk.

chunkBreakType
The type of break that separates the previous chunk from the current chunk. Values are from the CHUNK_BREAKTYPE enumeration.

Return Value

S_OK if successful; otherwise an error code.

Remarks

CMFCFilterChunkValueImpl::SetSystemTimeValue

Sets the property by key to a SystemTime.

HRESULT SetSystemTimeValue(
    REFPROPERTYKEY pkey,
    const SYSTEMTIME& systemTime,
    CHUNKSTATE chunkType = CHUNK_VALUE,
    LCID locale=0,
    DWORD cwcLenSource=0,
    DWORD cwcStartSource=0,
    CHUNK_BREAKTYPE chunkBreakType=CHUNK_NO_BREAK);

Parameters

pkey
Specifies a property key.

systemTime
Specifies the chunk value to set.

chunkType
Flags indicate whether this chunk contains a text-type or a value-type property. Flag values are taken from the CHUNKSTATE enumeration.

locale
The language and sublanguage associated with a chunk of text. Chunk locale is used by document indexers to perform proper word breaking of text. If the chunk is neither text-type nor a value-type with data type VT_LPWSTR, VT_LPSTR, or VT_BSTR, this field is ignored.

cwcLenSource
The length in characters of the source text from which the current chunk was derived. A zero value signifies character-by-character correspondence between the source text and the derived text. A nonzero value means that no such direct correspondence exists.

cwcStartSource
The offset from which the source text for a derived chunk starts in the source chunk.

chunkBreakType
The type of break that separates the previous chunk from the current chunk. Values are from the CHUNK_BREAKTYPE enumeration.

Return Value

S_OK if successful; otherwise an error code.

Remarks

CMFCFilterChunkValueImpl::SetTextValue

Sets the property by key to a Unicode string.

HRESULT SetTextValue(
    REFPROPERTYKEY pkey,
    LPCTSTR pszValue,
    CHUNKSTATE chunkType = CHUNK_VALUE,
    LCID locale = 0,
    DWORD cwcLenSource = 0,
    DWORD cwcStartSource = 0,
    CHUNK_BREAKTYPE chunkBreakType = CHUNK_NO_BREAK);

Parameters

pkey
Specifies a property key.

pszValue
Specifies the chunk value to set.

chunkType
Flags indicate whether this chunk contains a text-type or a value-type property. Flag values are taken from the CHUNKSTATE enumeration.

locale
The language and sublanguage associated with a chunk of text. Chunk locale is used by document indexers to perform proper word breaking of text. If the chunk is neither text-type nor a value-type with data type VT_LPWSTR, VT_LPSTR, or VT_BSTR, this field is ignored.

cwcLenSource
The length in characters of the source text from which the current chunk was derived. A zero value signifies character-by-character correspondence between the source text and the derived text. A nonzero value means that no such direct correspondence exists.

cwcStartSource
The offset from which the source text for a derived chunk starts in the source chunk.

chunkBreakType
The type of break that separates the previous chunk from the current chunk. Values are from the CHUNK_BREAKTYPE enumeration.

Return Value

S_OK if successful; otherwise an error code.

Remarks

See also

Classes