 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
lendle Guest
|
Posted: Wed Jun 29, 2005 6:38 am Post subject: event sink for DIID_HTMLInputTextElementEvents2 |
|
|
Excuse me,
if I write event sink for DIID_HTMLInputTextElementEvents2ĦA
what information can I get from
InvokeEvent(DISPID id, TVariant* params)?
I know there is a params argument, but it is TVariant,
how can I decode information from that argument if I catch
onclick event from the input element?
Furthermore, if the event was fired from javascript, is there any
chance to store an com object with the event and catch that object
in bcb?
thanks
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Wed Jun 29, 2005 6:40 pm Post subject: Re: event sink for DIID_HTMLInputTextElementEvents2 |
|
|
"lendle" <lendle (AT) iis (DOT) sinica.edu.tw> wrote
| Quote: | if I write event sink for DIID_HTMLInputTextElementEvents2
what information can I get from InvokeEvent(DISPID id, TVariant* params)?
|
I assume that you have not read the documentation yet, correct?
HTMLInputTextElementEvents2 Dispinterface
http://msdn.microsoft.com/workshop/browser/mshtml/reference/events/htmlinputtextelementevents2/htmlinputtextelementevents2.asp
| Quote: | I know there is a params argument, but it is TVariant,
how can I decode information from that argument if I catch
onclick event from the input element?
|
HRESULT MySink::InvokeEvent(DISPID id, TVariant* params)
{
switch( id )
{
//...
case DISPID_HTMLELEMENTEVENTS2_ONCLICK:
{
TComInterface<IHTMLEventObj, &IID_IHTMLEventObj> EventIntf;
EventIntf = V_DISPATCH(¶ms[0]);
if( EventIntf )
// use EventIntf as needed...
break;
}
//...
}
return S_OK;
}
Do note that the onclick event has a VARIANT_BOOL return value to indicate
whether the event can bubble to other event handlers. However,
TEventDispatcher::InvokeEvent() does not expose any means of setting the
return value for events. So if you need to return a value from an event,
you cannot use TEventDispatcher for it. You will have to write your own
IDispatch implementation from scratch so that you can implement
IDispatch::Invoke() directly.
| Quote: | Furthermore, if the event was fired from javascript, is there any
chance to store an com object with the event and catch that object
in bcb?
|
The only object that is available in the event is the one that the browser
itself provides - the object that click() was called upon. You cannot
specify your own objects.
Gambit
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|