ITfInsertAtSelection::InsertEmbeddedAtSelection method (msctf.h)

The ITfInsertAtSelection::InsertEmbeddedAtSelection method inserts an IDataObject object at the selection or insertion point.

Syntax

HRESULT InsertEmbeddedAtSelection(
  [in]  TfEditCookie ec,
  [in]  DWORD        dwFlags,
  [in]  IDataObject  *pDataObject,
  [out] ITfRange     **ppRange
);

Parameters

[in] ec

Identifies the edit context. This is obtained from ITfDocumentMgr::CreateContext or ITfEditSession::DoEditSession.

[in] dwFlags

Bit field with one of the following values:

TF_IAS_NOQUERY

The ppRange parameter is NULL on exit.

TF_IAS_QUERYONLY

Context is not modified but the ppRange parameter is set as if the insert occurred. Read-only access is sufficient. If this flag is not set, the ec parameter must have read/write access.

TF_IAS_NO_DEFAULT_COMPOSITION

The TSF manager does not create a default composition if a composition is required. The caller must create a composition object that covers the inserted text before releasing the context lock.

[in] pDataObject

Pointer to object to insert.

[out] ppRange

Position of the inserted object. Optional.

Return value

This method can return one of these values.

Value Description
S_OK
The method was successful.
TF_E_NOLOCK
The ec parameter is an invalid edit cookie.
TF_E_DISCONNECTED
Context object is not on a document stack.
TS_E_NOSELECTION
Context has no selection.
TS_E_READONLY
Selection is read-only.
TF_E_FORMAT
Context owner cannot handle objects of the type provided by the pDataObject parameter.

Remarks

Callers can use the ITfQueryEmbedded::QueryInsertEmbedded method to determine if a particular object type is likely to be accepted by this method.

To insert text instead of an IDataObject object, use the ITfInsertAtSelection::InsertTextAtSelection method.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header msctf.h
DLL Msctf.dll
Redistributable TSF 1.0 on Windows 2000 Professional

See also

IDataObject

ITfDocumentMgr::CreateContext

ITfEditSession::DoEditSession

ITfInsertAtSelection

ITfInsertAtSelection::InsertTextAtSelection

ITfQueryEmbedded::QueryInsertEmbedded