Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] OLE capabilities in SWT

Hi Grant,

>> Is the following helpful?
>>  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet186.java?view=co
>
> Yes, I saw it, it helps a little.

To be more precise, I only had a look at it until now.
I tried to see what would happen when calling readSafeArray on the
2-cells range Variant that Excel returns. It appears that the VM
crashes at the 3rd line:
OS.MoveMemory(vt_type, pPostData, 2);
The reason is that pPostData == 0 because the variant is not by ref.
It appears to be ARRAY | VARIANT, and unless I am mistaken its
dimensions are [2][1]. So the sample case is already quite different
from the snippet (by ref, more dimensions) and I don't know how to
adapt it.

I also tried to check the SafeArray patch, and it seems to load the
data correctly but I don't know how to reconstruct the Variant (or
whatever other type it may contain) once I have the actual SafeArray
instance.

I am stuck because I don't know how many bytes to read and where for
each dimension depending on the data type, the number of dimensions
and whether it is by ref or not. Moreover, I am really not used to the
API related to Variant and all the C-style API. I'll continue
investigating but I start losing my hopes of making anything out of
SWT OLE API (I have 2 ActiveX for which I want to generate a model and
both use SafeArrays).

Cheers,
-Christopher


Back to the top