Re: getting an event handler from a active-x dll dispinterface
- From: "Maarten Wiltink" <maarten@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 26 Dec 2006 10:46:51 +0100
"HanslH" <no@xxxxx> wrote in message
news:v7i0p2p9c28ilh3rtce3mpu0jedir0o5mk@xxxxxxxxxx
I used EventSinkImp to create a component based on the event-object.
The component is only very simple, it just has the youhaveamessage
event and name and tag property in the object inspector.
Why a TComponent? Any object would do.
The event is not fired on incoming messages when i create an object
(which is logical since not even a port is opened or whatever).
The other class of which I did succesfully create an communication
object does have an openport, sendmessage,getmessage function. So one
way or the other I have to connect the two.
The event object-class has a connect method:
Connect (const ASource: IUnknown);
I don't know what an IUnkNown is
It's the TObject of interfaces, from which all other ones derive.
It allows having a single Connect method. The receiving object will
check that the interface supplied is of the right type, and only
fire events through it if it is.
Some strong type-checking is lost there, as you've found out.
but if I use the (connected and functioning) communcation object
as a parameter it does compile, it does run but it doesn't fire
events.
Calling a method on the event sink object to connect the source?
Odd. I would have expected the source (the communication object)
to have a method to pass the event sink object('s interface) to.
I know i display utter ignorance here. I don't want to become an
activeX expert.
No, you don't. I know too much about it for my own happiness.
Groetjes,
Maarten Wiltink
.
- Follow-Ups:
- References:
- getting an event handler from a active-x dll dispinterface
- From: HanslH
- Re: getting an event handler from a active-x dll dispinterface
- From: Maarten Wiltink
- Re: getting an event handler from a active-x dll dispinterface
- From: HanslH
- getting an event handler from a active-x dll dispinterface
- Prev by Date: Re: Modify R G and B of TColor
- Next by Date: Re: Modify R G and B of TColor
- Previous by thread: Re: getting an event handler from a active-x dll dispinterface
- Next by thread: Re: getting an event handler from a active-x dll dispinterface
- Index(es):
Relevant Pages
|