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.
| Value | Description |
|---|---|
|
The method completed successfully. |
|
The method was unable to obtain a valid interface pointer to paStart and/or paEnd. |
|
The paStart or paEnd anchors are outside of the document text. |
|
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 |
|
|
IDL |
|
|
DLL |
|
See also