ITextStoreAnchor::AdviseSink method (textstor.h)

The ITextStoreAnchor::AdviseSink method installs a new advise sink from the ITextStoreAnchorSink interface or modifies an existing advise sink.

Syntax

HRESULT AdviseSink(
  [in] REFIID   riid,
  [in] IUnknown *punk,
  [in] DWORD    dwMask
);

Parameters

[in] riid

Specifies the sink interface. The only supported value is IID_ITextStoreAnchorSink.

[in] punk

Pointer to the sink interface to advise. Cannot be NULL.

[in] dwMask

Specifies the events that notify the advise sink. For more information about possible parameter values, see TS_AS_* Constants.

Return value

This method can return one of these values.

Value Description
S_OK
The method was successful.
E_FAIL
The specified sink interface riid could not be obtained.
E_INVALIDARG
The specified sink interface is unsupported.
E_UNEXPECTED
The specified sink object could not be obtained.

Remarks

Subsequent calls with the same interface, represented by the punk parameter, are handled as requests to update the dwMask parameter. Servers should not call the AddRef method on the sink in response to such a request.

Servers only maintain a single connection point. Attempts to advise a second sink object fail until the original sink object is removed. Applications should use the ITextStoreAnchor::UnadviseSink method to unregister the sink object when notifications are not required.

Requirements

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

See also

ITextStoreAnchor

ITextStoreAnchor::UnadviseSink

TS_AS_* Constants