don't need an interface map either. You only need the sink map.
...
...
Hi,
Here it is:
#define IDC_Source 1
// CSink
class ATL_NO_VTABLE CSink :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CSink, &CLSID_Sink>,
public ISupportErrorInfo,
public IDispatchImpl<ISink, &IID_ISink, &LIBID_ClientLib, 1, 0>,
public IDispEventImpl<IDC_Source, CSink, &__uuidof(_ISourceEvents),
&__uuidof(_ServerLib), 1, 0>
{
public:
CSink();
DECLARE_REGISTRY_RESOURCEID(IDR_CLSSINK)
BEGIN_COM_MAP(CSink)
COM_INTERFACE_ENTRY(ISink)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(ISupportErrorInfo)
COM_INTERFACE_ENTRY_IID(DIID__ISourceEvents, IDispatch)
END_COM_MAP()
BEGIN_SINK_MAP(CSink)
SINK_ENTRY_EX(IDC_Source, __uuidof(_ISourceEvents), 1,
InitializationProgress)
SINK_ENTRY_EX(IDC_Source, __uuidof(_ISourceEvents), 2, InitializationDone)
END_SINK_MAP()
Thanks,
Almog
"Alexander Nickolov" wrote:
Show the declaration of your sink object and the source interface
it's implementing.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
"DispEventAdvise fails with 0x80040202" <DispEventAdvise fails with
0x80040202@discussions.microsoft.com> wrote in message
news:EF9B7413-204F-4423-8E58-1A38748E0C5C@microsoft.com...
Hi,
I'm trying to create a connection point sink object, and am having
these
problems: When calling DispEvenAdvise I get HRESULT of 0x80040202. This
happens on FindConnectionPoint. When I try to query the source object
for
IConnectionPointContainer and call FindConnectionPoint, it does work,
which
seems strange to me. But then I call ConnectionPoint::Advise using the
sink
object's IUnknown, and when the source fires the event, it fails. It
seems
to
try and call the method with the matching dispid from the sink object's
default interface, regardless of the event sink map. So I guess I'm
doing
something wrong, but what is it?
Thanks in advance,
Almog.