Board index » cppbuilder » event sink for DIID_HTMLInputTextElementEvents2

event sink for DIID_HTMLInputTextElementEvents2


2005-06-29 02:38:37 PM
cppbuilder80
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
 
 

Re:event sink for DIID_HTMLInputTextElementEvents2

"lendle" < XXXX@XXXXX.COM >wrote in message
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
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
 

Re:event sink for DIID_HTMLInputTextElementEvents2

"lendle" < XXXX@XXXXX.COM >wrote in message
Quote
if I write event sink for DIID_HTMLInputTextElementEvents2
what information can I get from InvokeEvent(DISPID id, TVariant* params)?
This is not an IDE issue. This group is for discussions related to use of
the IDE itself. Please do not cross-post. It is against Borland's
newsgroup guidelines (info.borland.com/newsgroups). Only post to the
single most appropropriate group. Your question has already been addressed
in the "borland.public.cppbuilder.activex" newsgroup.
Gambit
 

{smallsort}