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.

ITextStoreAnchor::QueryInsert method

The ITextStoreAnchor::QueryInsert method determines whether the specified start and end anchors are valid. Use this method to adjust an edit to a document before you execute the edit. The method must not return values outside the range of the document.

Syntax


HRESULT QueryInsert(
  [in]   IAnchor *paTestStart,
  [in]   IAnchor *paTestEnd,
  [in]   ULONG cch,
  [out]  IAnchor **ppaResultStart,
  [out]  IAnchor **ppaResultEnd
);

Parameters

paTestStart [in]

Receives a pointer to a start anchor for the inserted text.

paTestEnd [in]

Receives a pointer to an end anchor for the inserted text. This is the same as paTestStart if the text is inserted at a point instead of replacing selected text.

cch [in]

Length of replacement text.

ppaResultStart [out]

Pointer to the new anchor object at the starting location for the inserted text. If the value of this parameter is NULL, then text cannot be inserted at the specified position. This anchor cannot be outside the document.

ppaResultEnd [out]

Pointer to the new anchor object at the ending location for the inserted text. If the value of this parameter is NULL, then text cannot be inserted at the specified position. This anchor cannot be outside the document.

Return value

This method can return one of these values.

ValueDescription
S_OK

The method was successful.

E_FAIL

An unspecified error occurred.

E_INVALIDARG

The paTestStart or paTestEnd parameters are invalid.

E_OUTOFMEMORY

The attempt to instantiate the ppaResultStart and/or ppaResultEnd anchors failed.

 

Remarks

The values of ppaResultStart and ppaResultEnd depend upon how the application inserts text into the document. If ppaResultStart and ppaResultEnd are the same as paTestStart, the cursor is at the beginning of the inserted text after insertion. If ppaResultStart and ppaResultEnd are the same as paTextEnd, the cursor is at the end of the inserted text after insertion.

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

 

 

Community Additions

Show:
© 2014 Microsoft