Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
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

Attachment: OleHtmlDocument.java
Description: Binary data


Back to the top