CreateTextServices function

The CreateTextServices function creates an instance of a text services object. The text services object supports a variety of interfaces, including ITextServices and the Text Object Model (TOM).

Syntax


HRESULT CreateTextServices(
  _In_  IUnknown  *punkOuter,
  _In_  ITextHost *pITextHost,
  _Out_ IUnknown  **ppUnk
);

Parameters

punkOuter [in]

Type: IUnknown*

Pointer to the controlling IUnknown interface on the outer object if the text services object is being created as part of an aggregate object. This parameter can be NULL if the object is not part of an aggregate.

pITextHost [in]

Type: ITextHost*

Pointer to your implementation of the ITextHost interface. This pointer must not be NULL.

ppUnk [out]

Type: IUnknown**

Pointer to a variable that receives a pointer to the private IUnknown of the text services object. You can call QueryInterface on this pointer to retrieve ITextServices or ITextDocument interface pointers.

Return value

Type: HRESULT

If the text services object was created successfully, the return value is S_OK.

If the function fails, one of the following COM error codes are returned. For more information on COM error codes, see Error Handling in COM.

Return codeDescription
E_INVALIDARG

An invalid argument was passed in.

E_OUTOFMEMORY

Memory for text services object could not be allocated.

E_FAIL

The text services object could not be initialized.

 

Remarks

A text services object can be created as part of a standard COM-aggregated object. If it is, then callers should follow standard OLE32 rules for dealing with aggregated objects and caching interface pointers obtained through QueryInterface from the private IUnknown.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Textserv.h

Library

Riched20.lib

DLL

Msftedit.dll

See also

Reference
ITextDocument
ITextHost
ITextServices
Conceptual
Windowless Rich Edit Controls

 

 

Show: