Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ITextStoreAnchor::GetText method

The ITextStoreAnchor::GetText method returns information about text at a specified anchor position. This method returns the visible and hidden text and indicates if embedded data is attached to the text.

Syntax


HRESULT GetText(
  [in]   DWORD dwFlags,
  [in]   IAnchor *paStart,
  [in]   IAnchor *paEnd,
  [out]  WCHAR *pchText,
  [in]   ULONG cchReq,
  [out]  ULONG *pcch,
  [in]   BOOL fUpdateAnchor
);

Parameters

dwFlags [in]

Not used; should be zero.

paStart [in]

Specifies the starting anchor position.

paEnd [in]

Specifies the ending anchor position. If NULL, it is treated as if it were an anchor positioned at the very end of the text stream.

pchText [out]

Specifies the buffer to receive the text. May be NULL only when cchReq = 0.

cchReq [in]

Specifies the pchText buffer size in characters.

pcch [out]

Receives the number of characters copied into the pchText buffer.

fUpdateAnchor [in]

If TRUE, paStart will be repositioned just past the last character copied to pchText.

Return value

This method can return one of these values.

ValueDescription
S_OK

The method completed successfully.

E_FAIL

The method was unable to obtain a valid interface pointer to paStart and/or paEnd.

TF_E_INVALIDPOS

The paStart or paEnd anchors are outside of the document text.

TS_E_NOLOCK

The caller does not have a read-only lock on the document.

 

Remarks

Callers that use this method must have a read-only lock on the document by calling the ITextStoreAnchor::RequestLock method. Without a read-only lock, the method fails and returns TF_E_NOLOCK.

Applications can truncate the method return values for internal reasons.

To quickly scan text with multiple GetText calls, a caller would use fUpdateAnchor = TRUE.

The actual number of characters copied could be less than cchReq if the number of characters between paStart and paEnd is less than cchReq.

The behavior of GetText is not affected by any region boundaries covered by the returned text.

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

Textstor.h

IDL

Textstor.idl

DLL

Msctf.dll

See also

ITextStoreAnchor
ITextStoreAnchor::RequestLock
TS_RUNINFO
Manager Return Values

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.