Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ITfReadOnlyProperty::EnumRanges method

Syntax


HRESULT EnumRanges(
  [in]  TfEditCookie  ec,
  [out] IEnumTfRanges **ppEnum,
  [in]  ITfRange      *pTargetRange
);

Parameters

ec [in]

Contains an edit cookie that identifies the edit context. This is obtained from ITfDocumentMgr::CreateContext or ITfEditSession::DoEditSession.

ppEnum [out]

Pointer to an IEnumTfRanges interface pointer that receives the enumerator object. The caller must release this object when it is no longer required.

pTargetRange [in]

Pointer to an ITfRange interface that specifies the range to scan for unique property values. This parameter is optional and can be NULL. For more information, see the Remarks section.

Return value

This method can return one of these values.

ValueDescription
S_OK

The method was successful.

E_INVALIDARG

One or more parameters are invalid.

E_OUTOFMEMORY

A memory allocation failure occurred.

E_FAIL

An unspecified error occurred.

Note  If an application does not implement ITextStoreACP::FindNextAttrTransition, ITfReadOnlyProperty::EnumRanges fails with E_FAIL.
 
TF_E_NOLOCK

The edit context identified by ec does not have a read-only or read/write lock.

 

Remarks

Note: If an application does not implement ITextStoreACP::FindNextAttrTransition, ITfReadOnlyProperty::EnumRanges fails with E_FAIL.

The enumerator obtained by this method will contain a range for each unique value, including empty values, of the specified property. For example, a hypothetical color property can be applied to the following marked up text:


COLOR:      RR      GGGGGGGG
TEXT:  this is some colored text

When ITfReadOnlyProperty::EnumRanges is called with pTargetRange set to this range, the enumerator will contain five ranges.

Range IndexColor Property ValueRange Text
0<empty>"this "
1R"is"
2<empty>" some "
3G"colored "
4<empty>"text"

 

If pTargetRange is NULL, then the enumerator will begin and end with the first and last range that contains a non-empty property value in the context. Specifying NULL for pTargetRange in the above example would result in an enumerator with three ranges.

Range IndexColor Property ValueText Within Range
0R"is"
1<empty>" some "
2G"colored "

 

The enumerated ranges will begin and end with the start and end anchors of pTargetRange, even if either anchor is positioned in the middle of a property.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]

Redistributable

TSF 1.0 on Windows 2000 Professional

Header

Msctf.h

IDL

Msctf.idl

DLL

Msctf.dll

See also

ITfReadOnlyProperty
ITfDocumentMgr::CreateContext
ITfEditSession::DoEditSession
IEnumTfRanges
ITfRange

 

 

Show:
© 2017 Microsoft