Skip to content

Latest commit

 

History

History
161 lines (103 loc) · 6.06 KB

composite-control-macros.md

File metadata and controls

161 lines (103 loc) · 6.06 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Composite Control Macros
Composite Control Macros
05/06/2019
atlcom/ATL::BEGIN_SINK_MAP
atlcom/ATL::END_SINK_MAP
atlcom/ATL::SINK_ENTRY
ATLCOM/BEGIN_SINK_MAP
ATLCOM/END_SINK_MAP
ATLCOM/SINK_ENTRY
ATLCOM/SINK_ENTRY_EX
ATLCOM/SINK_ENTRY_EX_P
ATLCOM/SINK_ENTRY_INFO
ATLCOM/SINK_ENTRY_INFO_P
BEGIN_SINK_MAP
END_SINK_MAP
SINK_ENTRY
SINK_ENTRY_EX
SINK_ENTRY_EX_P
SINK_ENTRY_INFO
SINK_ENTRY_INFO_P
composite controls, macros
17f2dd5e-07e6-4aa6-b965-7a361c78c45e

Composite Control Macros

These macros define event sink maps and entries.

Macro Description
BEGIN_SINK_MAP Marks the beginning of the event sink map for the composite control.
END_SINK_MAP Marks the end of the event sink map for the composite control.
SINK_ENTRY Entry to the event sink map.
SINK_ENTRY_EX Entry to the event sink map with an extra parameter.
SINK_ENTRY_EX_P (Visual Studio 2017) Similar to SINK_ENTRY_EX except that it takes a pointer to iid.
SINK_ENTRY_INFO Entry to the event sink map with manually supplied type information for use with IDispEventSimpleImpl.
SINK_ENTRY_INFO_P (Visual Studio 2017) Similar to SINK_ENTRY_INFO except that it takes a pointer to iid.

Requirements

Header: atlcom.h

BEGIN_SINK_MAP

Declares the beginning of the event sink map for the composite control.

BEGIN_SINK_MAP(_class)

Parameters

_class
[in] Specifies the control.

Example

[!code-cppNVC_ATL_Windowing#104]

Remarks

CE ATL implementation of ActiveX event sinks only supports return values of type HRESULT or void from your event handler methods. Any other return value is unsupported and its behavior is undefined.

END_SINK_MAP

Declares the end of the event sink map for the composite control.

END_SINK_MAP()

Example

[!code-cppNVC_ATL_Windowing#104]

Remarks

CE ATL implementation of ActiveX event sinks only supports return values of type HRESULT or void from your event handler methods. Any other return value is unsupported and its behavior is undefined.

SINK_ENTRY

Declares the handler function (fn) for the specified event (dispid), of the control identified by id.

SINK_ENTRY( id, dispid, fn )

Parameters

id
[in] Identifies the control.

dispid
[in] Identifies the specified event.

fn
[in] Name of the event handler function. This function must use the _stdcall calling convention and have the appropriate dispinterface-style signature.

Example

[!code-cppNVC_ATL_Windowing#104]

Remarks

CE ATL implementation of ActiveX event sinks only supports return values of type HRESULT or void from your event handler methods. Any other return value is unsupported and its behavior is undefined.

SINK_ENTRY_EX and SINK_ENTRY_EX_P

Declares the handler function (fn) for the specified event (dispid), of the dispatch interface (iid), for the control identified by id.

SINK_ENTRY_EX( id, iid, dispid, fn )
SINK_ENTRY_EX_P( id, piid, dispid, fn ) // (Visual Studio 2017)

Parameters

id
[in] Identifies the control.

iid
[in] Identifies the dispatch interface.

piid
[in] Pointer to the dispatch interface.

dispid
[in] Identifies the specified event.

fn
[in] Name of the event handler function. This function must use the _stdcall calling convention and have the appropriate dispinterface-style signature.

Example

[!code-cppNVC_ATL_Windowing#136]

Remarks

CE ATL implementation of ActiveX event sinks only supports return values of type HRESULT or void from your event handler methods. Any other return value is unsupported and its behavior is undefined.

SINK_ENTRY_INFO and SINK_ENTRY_INFO_P

Use the SINK_ENTRY_INFO macro within an event sink map to provide the information needed by IDispEventSimpleImpl to route events to the relevant handler function.

SINK_ENTRY_INFO( id, iid, dispid, fn, info )
SINK_ENTRY_INFO_P( id, piid, dispid, fn, info ) // (Visual Studio 2017)

Parameters

id
[in] Unsigned integer identifying the event source. This value must match the nID template parameter used in the related IDispEventSimpleImpl base class.

iid
[in] IID that identifies the dispatch interface.

piid
[in] Pointer to IID that identifies the dispatch interface.

dispid
[in] DISPID identifying the specified event.

fn
[in] Name of the event handler function. This function must use the _stdcall calling convention and have the appropriate dispinterface-style signature.

info
[in] Type information for the event handler function. This type information is provided in the form of a pointer to an _ATL_FUNC_INFO structure. CC_CDECL is the only option supported in Windows CE for the CALLCONV field of the _ATL_FUNC_INFO structure. Any other value is unsupported thus its behavior undefined.

Remarks

The first four macro parameters are the same as the ones for the SINK_ENTRY_EX macro. The final parameter provides type information for the event. CE ATL implementation of ActiveX event sinks only supports return values of type HRESULT or void from your event handler methods. Any other return value is unsupported and its behavior is undefined.

See also

Macros
Composite Control Global Functions