ATL DLL event sink with a VB ActiveX DLL event source 
Author Message
 ATL DLL event sink with a VB ActiveX DLL event source

How can I get this combination to work?

I've got an VB ActiveX DLL which sources events. I want to
sink these events into a C++ ATL DLL and I can't seem to
get this combination to work.

I think the VB ActiveX DLL is working properly, because I
can sink these same events into other VB ActiveX DLLs or
VB ActiveX EXEs.

Thank you.



Sun, 16 Oct 2005 00:50:48 GMT  
 ATL DLL event sink with a VB ActiveX DLL event source
See

http://msdn.microsoft.com/library/en-us/vcmfc98/html/vcconusingidispe...
http://msdn.microsoft.com/library/en-us/vcsample98/html/vcrefatlevent...

VB ActiveX should not be any different from any other ActiveX. You
#import its type library and build the sink with IDispEventImpl.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> How can I get this combination to work?

> I've got an VB ActiveX DLL which sources events. I want to
> sink these events into a C++ ATL DLL and I can't seem to
> get this combination to work.

> I think the VB ActiveX DLL is working properly, because I
> can sink these same events into other VB ActiveX DLLs or
> VB ActiveX EXEs.



Sun, 16 Oct 2005 01:15:10 GMT  
 ATL DLL event sink with a VB ActiveX DLL event source
Yes, that's what I thought too.

A VB ActiveX DLL should not be any different than sinking events from any
other ActiveX DLL.

But you know, there don't seem to be any code samples available that use
this specific combination: an event source written as a VB ActiveX DLL and
an event sink written as a C++ ATL DLL. (I've even tried writing the sink as
a C++ ATL EXE, but no luck).

I have already sucessfully duplicated the event code related parts of this
VB ActiveX DLL as a C++ ATL DLL and I can sink those events all day into VB
ActiveX DLLs, VB ActiveX Exes, C++ ATL DLLs, and C++ ATL EXEs.

There must be some special trick to get the specific combination I'm trying
to use to work properly.

It seems that if the event source is written as C++ ATL code, there's no
trouble sinking those event into anything else.

Yet, if the event source is written as a VB ActiveX DLL, the only
combination I can get to work is a sink written as a VB ActiveX DLL or EXE.

Any other ideas would be welcome.

Thank you.


Quote:
> See

http://msdn.microsoft.com/library/en-us/vcmfc98/html/vcconusingidispe...
http://msdn.microsoft.com/library/en-us/vcsample98/html/vcrefatlevent...
Quote:

> VB ActiveX should not be any different from any other ActiveX. You
> #import its type library and build the sink with IDispEventImpl.
> --
> With best wishes,
>     Igor Tandetnik

> "For every complex problem, there is a solution that is simple, neat,
> and wrong." H.L. Mencken



> > How can I get this combination to work?

> > I've got an VB ActiveX DLL which sources events. I want to
> > sink these events into a C++ ATL DLL and I can't seem to
> > get this combination to work.

> > I think the VB ActiveX DLL is working properly, because I
> > can sink these same events into other VB ActiveX DLLs or
> > VB ActiveX EXEs.



Sun, 16 Oct 2005 01:38:43 GMT  
 ATL DLL event sink with a VB ActiveX DLL event source

Quote:
> It seems that if the event source is written as C++ ATL code, there's
no
> trouble sinking those event into anything else.

> Yet, if the event source is written as a VB ActiveX DLL, the only
> combination I can get to work is a sink written as a VB ActiveX DLL or

EXE.

What specifically do you have problems with? Which part does not work as
expected?
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken



Sun, 16 Oct 2005 01:50:17 GMT  
 ATL DLL event sink with a VB ActiveX DLL event source
Specifically, I can't get the events which are sourced from a VB ActiveX DLL
to sink into a C++ ATL DLL.

This is the case even though in my C++ ATL DLL the code: "hr =
DispEventAdvise(m_pServerPtr);" results in an hr = 0. It appears that the
DispEventAdvise is sucessful.

Again, if I swap out my VB ActiveX DLL with a C++ ATL DLL that sources the
same events, everything works as expected. Also, if I swap out the C++ ATL
DLL with a VB ActiveX DLL or EXE the event will sink properly. Its just the
specific combination of a VB ActiveX DLL as an event source, with either a
C++ ATL DLL or EXE that does not work properly.

There must be some technique to get this to work properly (the IDL, tlh,
tli, or some special argument to the #import command).

Thanks again for your assistance.


Quote:


> > It seems that if the event source is written as C++ ATL code, there's
> no
> > trouble sinking those event into anything else.

> > Yet, if the event source is written as a VB ActiveX DLL, the only
> > combination I can get to work is a sink written as a VB ActiveX DLL or
> EXE.

> What specifically do you have problems with? Which part does not work as
> expected?
> --
> With best wishes,
>     Igor Tandetnik

> "For every complex problem, there is a solution that is simple, neat,
> and wrong." H.L. Mencken



Sun, 16 Oct 2005 02:24:04 GMT  
 ATL DLL event sink with a VB ActiveX DLL event source

Quote:
> Specifically, I can't get the events which are sourced from a VB
ActiveX DLL
> to sink into a C++ ATL DLL.

> This is the case even though in my C++ ATL DLL the code: "hr =
> DispEventAdvise(m_pServerPtr);" results in an hr = 0. It appears that
the
> DispEventAdvise is sucessful.

Show how you declare IDispEventImpl. Show your sink map. It's likely you
are misconfiguring some IID or DISPID somewhere.

Put a breakpoint on IDispEventSimpleImpl::Invoke (<atlcom.h> line 3694
in VC6). If it gets called (I expect it does), step through it and see
why it fails to call your sink.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken



Sun, 16 Oct 2005 02:42:18 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. ATL COM Component firing events into VBScript event sink

2. Event source and sink for COM without ATL or MFC

3. How to catch events fired by VB-written ActiveX DLL in VC++ client

4. Atl Dll events stop in VB IDE after error triggered

5. VB Auto-generation of certain events (was Re: VB refuses to load my control DLL)

6. Problem with ATL Sink class for catching another ATL's events

7. Creating an event sink for #imported dll

8. Regular DLL and event sink

9. ATL Service - Need to establish sink for a connection point of ActiveX dll

10. Fire an Event, sink a event - Help!

11. How to event sink to events in the same IDispatch derived class

12. Event Sink for a COM object which raises events - Proof of Concept

 

 
Powered by phpBB® Forum Software