[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[platform-swt-dev] OLE capabilities in SWT
- From: Christopher Deckers <chrriis@xxxxxxxxx>
- Date: Mon, 5 Jul 2010 19:37:15 +0200
- Delivered-to: firstname.lastname@example.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=63UfR94WGS4vNji57/48iIpoGqeYAO6yIrNO/M6k2aQ=; b=jcIqx6Y3tVyUTlc3ViISqWiTjaYuOydBlTfrqxJi5KQVwqbOWpaS9GajFAZ1I3Hs1T g7vjyHTAohWRFhLQ6+9JtS5VlgE/dguDyM/oXD3xFJgCt2BaoQsdI5k0wMx8/oWWZf32 /dSxjRahWL6+2IFRrgNQWZWxagG7nEG91lo+Y=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=BUsOZ07T02o6I2/YbRjEhJJ/m+xxkv3RUksbALkALr9VOk4T7vd6E1Rj2/I/gG6rdV aBlY6L4HIw2hCLsa0q3DmNt9XiAdZbG2E0MhTWq4W3aqbWCyVNMOrFtD0Bzqce7YGNcH lSkh21T5i4aleEiikmZhhcQ63T5hq+3UlFI94=
First, this e-mail covers several aspects at once, some items one
might consider usage question.
Nevertheless, I am trying to figure out the state of things regarding
OLE in SWT so please bear with me.
I am inclined to open bug reports when something is clearly a
bug/limitation in SWT, and provide assistance with testing.
My test case is Excel 2010 on Windows 7.
I uploaded a test class along with a simple XLS file which shows the
results of my investigation: http://chrriis.free.fr/OleSWT.zip
Here is what I tried and the results:
1.a. Embed Excel inside an SWT UI.
1.b. Launch the application and pilot it from code.
=> OleAutomation(String) seems to allow it but it fails.
=> It seems the only problem is a missing flag in the
OleAutomation(String) constructor. Copying some of OleAutomation code
and using a bit of reflection shows that it works.
1.c. Connect to a running instance.
=> API does not seem to allow it.
=> I failed to find a way to do it. I think it (simply?) needs a
native call to GetActiveObject(clsid, NULL, ppvObject).
2. Read and write data to a range.
=> API only allows it for ranges of one cell.
=> When more than one cell is needed, the result is a SafeArray and I
could not get it to work. There is an old bug (93652) and a snippet
(186) which I failed to adapt for this case.
3. Attach event listeners.
=> I only did a quick test and it seems to work.
=> Any known limitations?
As I could work aroung 1.b, I am mostly stuck with 1.c and 2. Any
Should I open bug reports for 1.b and 1.c?
Can someone revive the SWT bug related to 2? Being able to read/write
ranges of data is critical when piloting Excel (I heard that the
Bloomberg ActiveX requires multi-dimensional arrays too so there are
definitely several important APIs using them).
Are there any plans to further improve OLE support in SWT?
Note that one of my goals related to OLE is to create a generic Java
interface generator which runtime implementation can be accomodated to
any COM bridge. I have a partial implementation for another COM bridge
but I am not convinced with the stability of that bridge and I think
SWT is not far from supporting all the necessary features. I am sure
such interface generator can be of interest to many OLE users so I
will probably publish it if I can get these features to work.
Thanks in advance,