ATL Event Sink using C# DLL Event Source

ATL Event Sink using C# DLL Event Source

Post by Igor Tande » Sun, 05 Sep 2004 04:06:35



SINK_ENTRY_INFO uses DISPIDs 0 and 1, whereas the IDL clearly shows
DISPIDs 0x60020000 and 0x60020001. The DISPID in SINK_ENTRY_INFO must
match the actual DISPID in the interface.
--
With best wishes,
Igor Tandetnik

"On two occasions, I have been asked [by members of Parliament], 'Pray,
Mr. Babbage, if you put into the machine wrong figures, will the right
answers come out?' I am not able to rightly apprehend the kind of
confusion of ideas that could provoke such a question." -- Charles
Babbage
 
 
 

ATL Event Sink using C# DLL Event Source

Post by SS9HZWF » Sun, 05 Sep 2004 05:13:04

Thanks for the quick reply.

You're correct, I was using the wrong DISPIDs. I've put in the correct
values and I'm still getting a 'Not Implemented' exception on the C# side.
I've rebuilt everything thinking I was using an old reference to something,
but I still receive the same message.

 
 
 

ATL Event Sink using C# DLL Event Source

Post by BlackHaw » Wed, 08 Sep 2004 18:23:21

9/4/2004 4:13:04 AM



< XXXX@XXXXX.COM >





correct

C# side.

something,










C# DLL


However, on

event





=*/ 0,


=*/ 1,

















shows

must






'Pray,

right


Charles





Hi,

you set IIGEClient_Events's Interface type as ComInterfaceType.
InterfaceIsIUnknown.

you can try it.

I am writting program about c# and vc interop. I have fire the event
successfully.

good lucky!
 
 
 

ATL Event Sink using C# DLL Event Source

Post by BlackHaw » Thu, 09 Sep 2004 15:08:00

9/7/2004 9:25:50 PM



< XXXX@XXXXX.COM >













event








InterfaceIsIUnknown, but

window an







exceptions on

Is there

side?



VT_EMPTY, 2,


{VT_BSTR











find it.



This is my vc code of calling c# com. It works fine. you can
reference.

_ATL_FUNC_INFO OnErrorInfo = {CC_STDCALL, VT_EMPTY, 2, {VT_VARIANT,
VT_DISPATCH}};

typedef IDispEventSimpleImpl<1, CEventSink,
&__uuidof(MyClass::EventInterface)>

EventSimpleImpl_Event;

class CEventSink : public EventSimpleImpl_Event

{

public:

CEventSink(IMyClassInterface m_myclass)

{

EventSimpleImpl_Event::DispEventAdvise(m_myclass);

}

~CEventSink()

{

if(&m_myclass != 0)

{

EventSimpleImpl_Event::DispEventUnadvise(m_myclass);

}

}

}

IMyClassInterface m_com(__uuidof(MyClass));

CEventSink event = new CEventSink(m_com);