Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
TSF Reference
TSF Interfaces
ITfDocumentMgr
 ITfDocumentMgr::CreateContext Metho...
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

The method can return one of the following 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 clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
RedistributableTSF 1.0 onWindows NT 4.0,Windows 2000 ProfessionalandWindows MeWindows 98
HeaderMsctf.idl and Msctf.h
DLLMsctf.dll

See Also

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

Send comments about this topic to Microsoft

Build date: 7/14/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker