Marshalling byte array in a variant
Al Harper <[email protected]> Wed, 21 Sep 2005 10:30:48 -0400
| Newsgroups | gmane.comp.windows.devel.jawin |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
I've been having trouble trying to marshal a byte array contain in variant.
Heres' the COM object methods signature as generated by the JAWIN browser.
public int SetControl(Variant vtag,Variant vvalue,Variant vstatBuff,Variant
vbuffSize,Variant vstatLen) throws COMException
The sample code provided for the API to this method is in VB:
Dim vtag As Long
Dim vvalue(128) As Byte
Dim vinfBuff(256) As Byte
Dim vbuffSize As Long
Dim vinfLen(1) As Long
SetControl(vtag, vvalue, vinfBuff, vbuffSize, vinfLen)
I'm having a lot of trouble getting this byte array marshaled. Throwing
excpetions etc. In looking at the source code for the JAWIN Variant class it
seems obvious what the problem is. The only case statement for marshalling
byte(s) in the marshalInVariant() method is:
case VT_UI1:
leos.writeShort(var.vt);
leos.writeByte(var.bVal);
break;
There is no code for marshaling the entire byte array. What am I missing?
Can someone help?
Thanks Al Harper