#pragma once #include #include #include #include #include using SinkHandler = std::function; // The events interface the control declares as its default source. Its type // info is where the event names come from. ITypeInfo* sourceTypeInfo(IDispatch* control, IID* source); // A sink that turns a dispid into the event name before handing the call on, so // the caller works in names rather than in numbers the OCX is free to renumber. IDispatch* createEventSink(ITypeInfo* events, REFIID source, SinkHandler handler);