Variant encoded POINT
Schurer <[email protected]> Fri, 22 Jul 2005 07:08:24 -0400
| Newsgroups | gmane.comp.windows.devel.jawin |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
I am having a problem with passing parameters to and from a dll. Using the
typebrowser I have generated classes to approach the dll. At the moment my
problem is that I try to call a function that has a single parameter: a
Variant in which a two-dimensional coordinate is encoded.
The relevant part of my code:
IRoutePlanner rp = new IRoutePlanner();
POINT p = new POINT();
p.x = 135875;
p.y = 452050;
Variant v = new Variant();
int punt[] = {p.x, p.y};
v.pintVal = punt;
v.vt = Variant.VT_I4 | Variant.VT_ARRAY;
rp.setStartPoint(v);
This results in the following error message:
[java] org.jawin.COMException: 8000ffff: passed end of stream in the
marshalling layer
[java] at org.jawin.marshal.GenericStub.dispatchInvoke0(Native
Method)
[java] at org.jawin.marshal.GenericStub.dispatchInvoke
(GenericStub.java:84)
[java] at org.jawin.DispatchPtr.putN(DispatchPtr.java:365)
[java] at org.jawin.DispatchPtr.put(DispatchPtr.java:245)
[java] at org.anwb.hv.geo.dll_types.IRoutePlanner.setStartPoint
(IRoutePlanner.java:260)
...
The function setStartPoint() has a Variant-encoded point as parameter. I
haven't found out how to construct such a parameter. Can someone explain to
me how I can do this?
I couldn't find anything that helped me with this in the mailing list.