HrThisThreadAdviseSink
The HrThisThreadAdviseSink
function creates an advise sink that wraps an existing advise sink for thread
safety.
Quick Info
Header
file: |
MAPIUTIL.H |
Implemented
by: |
MAPI |
Called by: |
Client
applications |
HrThisThreadAdviseSink(
LPMAPIADVISESINK lpAdviseSink, |
|
LPMAPIADVISESINK FAR * lppAdviseSink |
|
); |
|
Parameters
lpAdviseSink
[in] Pointer
to the advise sink to be wrapped.
lppAdviseSink
[out] Pointer
to a pointer to a new advise sink that wraps the advise sink pointed to by the lpAdviseSink
parameter.
Remarks
The purpose
of the wrapper is to ensure that notification is called on the same thread that
called the HrThisThreadAdviseSink function. This function is used to
protect notification callbacks that must run on a particular thread.
Client applications
should use HrThisThreadAdviseSink to restrict when notifications are
generated. This happens when calls are made to the IMAPIAdviseSink::OnNotify
HrThisThreadAdviseSink ensures that the OnNotify methods calls occur
at these appropriate times:
During the processing of any
call to any MAPI method.
When window messages are being
processed.
When HrThisThreadAdviseSink
is implemented, any calls to the new advise sink s OnNotify method on any thread cause the original notification
method to be executed on the thread in which HrThisThreadAdviseSink was
called.
For more
information on notification and advise sinks, see Event Notification in MAPI