[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [platform-swt-dev] Implementing IID_IDispatch from within Eclipse
|
Title: Message
In my
case, I have to build IDispatch implementations because I am interacting
directly with the DOM and its event model which is distinct from OLE's notion of
events related to an embedded container. The former isn't addressed by the
addEventListener(...) methods.
I have a question
about why you are creating these IDispatch objects. You say " I don't
need to attach an IDispatch object to every event I am interested in if I can
embed a single global callback object for all events."
There is API on OleControlSite which is:
public void
addEventListener(int eventID, OleListener
listener)
public void
addEventListener(OleAutomation automation, int eventID, OleListener
listener)
These two methods
use the IDispatch object implemented in OleEventSink ( a common definition of
IDispatch that is used for all events) and give notification when the
events change. Is this API not sufficient for what you are doing?
Do you really need to be implementing IDispatch at all?
| "Seymour Kellerman/Cambridge/IBM"
<seymour_kellerman@xxxxxxxxxx> Sent by:
platform-swt-dev-admin@xxxxxxxxxxx
17/04/2002 02:58 PM Please respond to platform-swt-dev
| To:
platform-swt-dev@xxxxxxxxxxx cc:
lmonson@xxxxxxxxxxxx Subject:
RE: [platform-swt-dev] Implementing IID_IDispatch from within
Eclipse |
Thank you for your continuing guidance, Veronika and Lynn, as in
http://dev.eclipse.org/mhonarc/lists/platform-swt-dev/msg00741.html
With the
information you've provided, I can try to create an IDispatchImpl
class...
Two further questions:
1.What is the commitment
to support creating an IDispatch object in SWT Release 2?
This feature would add much to SWT's Ole support.
Currently, any implementation I can build must be based on SWT internal
classes. Do you plan to offer any more public support in R2?
2. How
about passing an IDispatch object into the IWebBrowser DOM by executing a
_javascript_?
We are looking for the ability to install DHTML event
handlers into an IE DOM that call back to Java code. Why not pass an
Eclipse IDispatch object that includes my favorite callback methods into the
DOM via _javascript_ (see below)? I don't need to attach an IDispatch
object to every event I am interested in if I can embed a single global
callback object for all events. Is this a viable strategy?
Execute a named _javascript_ in an IE DOM as follows:
From
IWebBrowser get the IHTMLDocument automation with the Document()
property.
From IHTMLDocument get the Script Engine automation with the Script()
property.
Use ScriptEngineOleAutomation.getIDsOfNames(new
String[]{"myfunctionName"}) to get a dispatch ID for a function you know is on the
page.
Use ScriptEngineOleAutomation.invoke(functionID, args) to invoke the
function, passing an IDispatch Variant to the page DOM.
Representative code snippet below.
Seymour Kellerman
IBM Research
1 Rogers
Street
Cambridge MA 02142
Seymour_Kellerman@xxxxxxxxxx
617 693-5412