IDispEventSimpleImpl

template <UINT nID, class T, const IID* pdiid>
class ATL_NO_VTABLE IDispEventSimpleImpl : public _IDispEventLocator<
nID, pdiid>

Parameters

nID

A unique identifier for the source object. When IDispEventSimpleImpl is the base class for a composite control, use the resource ID of the desired contained control for this parameter. In other cases, use an arbitrary positive integer.

T

The user's class, which is derived from IDispEventSimpleImpl.

pdiid

The pointer to the IID of the event dispinterface implemented by this class.

IDispEventSimpleImpl provides a way of implementing an event dispinterface without requiring you to supply implementation code for every method or event on that interface. IDispEventSimpleImpl provides implementations of the IDispatch methods. You only need to supply implementations for the events that you're interested in handling.

IDispEventSimpleImpl works with the event sink map in your class to route events to the appropriate handler function. To use this class:

You must derive from IDispEventSimpleImpl (using a unique value for nID) for each object for which you need to handle events. You can reuse the base class by unadvising against one source object then advising against a different source object, but the maximum number of source objects that can be handled by a single object at one time is limited by the number of IDispEventSimpleImpl base classes.

IDispEventSimplImpl provides the same functionality as IDispEventImpl, except it does not get type information about the interface from a type library. The wizards generate code based only on IDispEventImpl, but you can use IDispEventSimpleImpl by adding the code by hand. Use IDispEventSimpleImpl when you don't have a type library describing the event interface or want to avoid the overhead associated with using the type library.

Note   IDispEventImpl and IDispEventSimpleImpl provide their own implementation of IUnknown::QueryInterface, enabling each IDispEventImpl or IDispEventSimpleImpl base class to act as a separate COM identity while still allowing direct access to class members in your main COM object.

For more information, see Supporting IDispEventImpl.

#include <atlcom.h>

Class Members

See Also

_ATL_FUNC_INFO, IDispatchImpl, IDispEventImpl, SINK_ENTRY_INFO