CreateContext
Collapse the table of content
Expand the table of content

ITfDocumentMgr::CreateContext method

Syntax


HRESULT CreateContext(
  [in]  TfClientId   tidOwner,
  [in]  DWORD        dwFlags,
  [in]  IUnknown     *punk,
  [out] ITfContext   **ppic,
  [out] TfEditCookie *pecTextStore
);

Parameters

tidOwner [in]

The client identifier. For an application, this value is provided by a previous call to ITfThreadMgr::Activate. For a text service, this value is provided in the text service ITfTextInputProcessor::Activate method.

dwFlags [in]

Reserved, must be zero.

punk [in]

Pointer to an object that supports the ITextStoreACP or ITfContextOwnerCompositionSink interfaces. This value can be NULL.

ppic [out]

Address of an ITfContext pointer that receives the context.

pecTextStore [out]

Pointer to a TfEditCookie value that receives an edit cookie for the new context. This value identifies the context in various methods.

Return value

This method can return one of these values.

ValueDescription
S_OK

The method was successful.

E_INVALIDARG

One or more parameters are invalid.

E_OUTOFMEMORY

A memory allocation error occurred.

E_FAIL

An unspecified error occurred.

 

Remarks

All references to the punk parameter are released when the context is destroyed or when the context is removed from the stack with the ITfDocumentMgr::Pop method.

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

Msctf.h

IDL

Msctf.idl

DLL

Msctf.dll

See also

ITfDocumentMgr
ITextStoreACP
ITfContext
ITfContextOwnerCompositionSink
ITfDocumentMgr::Pop
ITfTextInputProcessor::Activate
ITfThreadMgr::Activate
TfEditCookie

 

 

Show:
© 2016 Microsoft