
How to get a pointer to a byte array in vb4 or vb5
This is a multi-part message in MIME format.
------=_NextPart_000_01BC6769.EBFD3C00
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Use the VarPtr() function. It's not documented, but it's there. Don't =
know if it's in VB4, but VB5's got it. Assuming you pass the length of =
the byte array as well, you just call it like this:
myPtr =3D VarPtr(ByteArray(0))
... or whatever the lower bound of the array is.
--
-- Ben
SiteBuilder Network Level 2
Ben's VB5 Page -- This site has been Activated!
http://www.{*filter*}highway.com/~psy/
Requires IE3.01 or higher...
Stephan Brunner wrote in article =
I need to pass a pointer to a byte array (unicode) to an api function.
My question is now, how I can get this pointer (address) into a vb long
variable?
------=_NextPart_000_01BC6769.EBFD3C00
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">
<HTML>
<HEAD>
<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"Trident 4.71.0544.0"' name=3DGENERATOR>
</HEAD>
<BODY>
<P><FONT face=3DArial size=3D2>Use the VarPtr() function. It's not =
documented, but=20
it's there. Don't know if it's in VB4, but VB5's got it. Assuming you =
pass the=20
length of the byte array as well, you just call it like this:</FONT>
<P><FONT face=3DArial size=3D2>myPtr =3D VarPtr(ByteArray(0))</FONT>
<P><FONT face=3DArial size=3D2>... or whatever the lower bound of the =
array is.<BR>
--<BR>
<HTML><BODY><FONT size=3D2>-- Ben<BR>
SiteBuilder Network Level 2<BR>
Ben's VB5 Page -- This site has been Activated!<BR>
<A=20
href=3D"http://www.{*filter*}highway.com/~psy/">http://www.{*filter*}highway.com/~p=
sy/</A><BR>
Requires IE3.01 or higher...<BR>
</FONT></FONT>
<P><FONT face=3DArial size=3D2> <EM><FONT color=3D#808080>Stephan=20
<HTML><BODY>I need to pass a pointer to a byte array (unicode) to an api =
function.<BR>
My question is now, how I can get this pointer (address) into a vb =
long<BR>
variable?<BR>
</FONT></EM><FONT size=3D2><BR>
</FONT></FONT></P>
</BODY></HTML>
------=_NextPart_000_01BC6769.EBFD3C00--