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.

ITextStoreACP2::QueryInsert method

Determines whether the specified start and end character positions are valid. Use this method to adjust an edit to a document before executing the edit. The method must not return values outside the range of the document.

Syntax


HRESULT QueryInsert(
  [in]  LONG  acpTestStart,
  [in]  LONG  acpTestEnd,
  [in]  ULONG cch,
  [out] LONG  *pacpResultStart,
  [out] LONG  *pacpResultEnd
);

Parameters

acpTestStart [in]

Starting application character position for inserted text.

acpTestEnd [in]

Ending application character position for the inserted text. This value is equal to acpTextStart if the text is inserted at a point instead of replacing selected text.

cch [in]

Length of replacement text.

pacpResultStart [out]

Returns the new starting application character position of the inserted text. If this parameter is NULL, then text cannot be inserted at the specified position. This value cannot be outside the document range.

pacpResultEnd [out]

Returns the new ending application character position of the inserted text. If this parameter is NULL, then pacpResultStart is set to NULL and text cannot be inserted at the specified position. This value cannot be outside the document range.

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 acpTestStart or acpTestEnd parameters are invalid.

 

Remarks

The values of pacpResultStart and pacpResultEnd depend upon how the application inserts text into the document. If pacpResultStart and pacpResultEnd are the same as acpTextStart, the cursor is at the beginning of the inserted text after insertion. If pacpResultStart and pacpResultEnd are the same as acpTextEnd, the cursor is at the end of the inserted text after insertion. If the difference between pacpResultStart and pacpResultEnd is equal to the length of the inserted text, the inserted text is highlighted after insertion.

Requirements

Minimum supported client

Windows 8 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 [desktop apps | Windows Store apps]

Header

Textstor.h

IDL

Textstor.idl

DLL

Msctf.dll

See also

ITextStoreACP2

 

 

Show:
© 2017 Microsoft