description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: CMFCFilterChunkValueImpl Class |
CMFCFilterChunkValueImpl Class |
11/04/2016 |
|
|
3c833f23-5b88-4d08-9e09-ca6a8aec88bf |
This is a class which simplifies both chunk and property value pair logic.
class CMFCFilterChunkValueImpl : public ATL::IFilterChunkValue;
Name | Description |
---|---|
CMFCFilterChunkValueImpl::~CMFCFilterChunkValueImpl | Destructs the object. |
CMFCFilterChunkValueImpl::CMFCFilterChunkValueImpl | Constructs the object. |
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. |
Name | Description |
---|---|
CMFCFilterChunkValueImpl::SetChunk | A helper function that sets the chunk's common properties. |
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);
ATL::IFilterChunkValue
Header: afxwin.h
Clears the ChunkValue.
void Clear();
Constructs the object.
CMFCFilterChunkValueImpl();
Destructs the object.
virtual ~CMFCFilterChunkValueImpl();
Copies this chunk to a structure describing the characteristics of a chunk.
HRESULT CopyChunk(STAT_CHUNK* pStatChunk);
pStatChunk
A pointer to destination value describing the characteristics of the chunk.
S_OK if successful; otherwise an error code.
Initializes this chunk value from the other value.
void CopyFrom (IFilterChunkValue* pValue);
pValue
Specifies the source value to copy from.
Retrieves the chunk GUID.
REFGUID GetChunkGUID() const;
A reference to a GUID identifying the chunk.
Retrieves the chunk PID (property ID).
DWORD GetChunkPID() const;
A DWORD value containing the property ID.
Retrieves the chunk type.
CHUNKSTATE GetChunkType() const;
A CHUNKSTATE enumerated value, which specifies whether the current chunk is a text-type property or a value-type property.
Retrieves the string value.
CString &GetString();
A string containing the chunk value.
Retrieves the value as an allocated propvariant.
HRESULT GetValue(PROPVARIANT** ppPropVariant);
ppPropVariant
When the function returns, this parameter contains the chunk value.
S_OK if PROPVARIANT was allocated successfully and the chunk value was successfully copied to ppPropVariant; otherwise an error code.
Returns the non-allocated (internal value) value.
PROPVARIANT GetValueNoAlloc ();
Returns the current chunk value.
Checks whether this property value is valid or not.
BOOL IsValid() const;
TRUE if the current chunk value is valid; otherwise FALSE.
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);
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.
S_OK if successful; otherwise an error code.
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);
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.
S_OK if successful; otherwise error code.
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);
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.
S_OK if successful; otherwise an error code.
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);
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.
S_OK if successful; otherwise an error code.
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);
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.
S_OK if successful; otherwise an error code.
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);
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.
S_OK if successful; otherwise an error code.
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);
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.
S_OK if successful; otherwise an error code.
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);
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.
S_OK if successful; otherwise an error code.
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);
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.
S_OK if successful; otherwise an error code.