Re: Variant arguments & com function calls

Morten Andersen <[email protected]>
Newsgroups gmane.comp.windows.devel.jawin
Organization Arosii Information Systems A/S
Message-ID <[email protected]>
Hi Alex

Alex Kotchnev wrote:

[SNIP - well documented questions]

>
>
> To summarize the questions questions:
> 1. When there is a function that takes a Variant, which field in Variant
> would have to be set ? I understand that maybe there is no general rule for
> this, but at least a hint would be helpful...

It should generally not be necessary to generate instances of
org.jawin.Variant. Most (if not all) marshalling will be handled
correctly by the automatic marshalling and the dispatch coercion
mechanism. Eg. java.lang.Integer -> VT_UI4.

I have recently refactored and documented a lot of this marshalling, so
I suggest you try to check out the latest CVS-release by following the
guidelines here http://jawinproject.sourceforge.net/jawindeveloper.html.
Besides the javadoc for org.jawin.DispatchPtr and org.jawin.Variant you
should check the docs/jawinuserguide_dispatch.html documentation (I have
just made checkins 5 minutes ago, which should be available on the
public CVS-server in approximately 5 hours).

> 2. Is there an equivalent to the C# Type.Missing, or some other way to
> indicate that the argument has to take its default value in the Com
> function invocation ?

We don't have that pt. You can try with "null", which get marshalled
into VT_NULL, but I assume we need to marshal into VT_EMPTY to get this
to work? But at least it sounds like it is something we have to support.

Hope this helps you a little bit. And as a sidenote, as I don't know
exactly what you are trying to do with Excel, but have you checked the
POI project http://jakarta.apache.org/poi/, for writing/reading Excel
files?.

Best Regards
Morten
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.