[
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
Not to
put too fine a point on this issue, but the "deviations" are much wider than
just DOM. COM allows for arbitrary interactions between components outside
of the limited OLE embedding event system. There are many COM based SDKs
which require two-way IDispatch implementations - IE is just a high-profile
example.
This appears to
be what Seymour is doing as well.
You
could probably take a clone of OleEventSink and just change the connect
disconnect method to do what you want. It is too bad the DOM deviates
from the regular event mechanism. Currently OleEvent sink is final and
package protected and I need to think how it can be made more general before I
would expose it otherwise.
| "Lynn Monson"
<lmonson@xxxxxxxxxxxx> Sent by: platform-swt-dev-admin@xxxxxxxxxxx
22/04/2002 10:24 AM Please respond to platform-swt-dev
| To:
<platform-swt-dev@xxxxxxxxxxx> cc:
Subject: RE: [platform-swt-dev]
Implementing IID_IDispatch from within
Eclipse |
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.
-----Original Message-----
From:
platform-swt-dev-admin@xxxxxxxxxxx [mailto:platform-swt-dev-admin@xxxxxxxxxxx]
On Behalf Of Veronika_Irvine@xxxxxxx
Sent: Wednesday, April 17, 2002 3:04
PM
To: platform-swt-dev@xxxxxxxxxxx
Subject: RE: [platform-swt-dev]
Implementing IID_IDispatch from within Eclipse
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