Hi,
Newbie here wondering how to initialize a byte array.
I'm working on the compact framework, and I keep getting
an error because the byte array is null.
Here is the code:
Dim ptr As IntPtr = DBAccessFuncDec l.GetLongVal()
Dim sval As String
Dim lval As Long
Dim size As Integer = 30 + 16
Dim bData As Byte()
***Marshal.Copy (ptr, bData, 0, size)*** HERE IS THE ERROR
sval = System.Text.ASC IIEncoding.ASCI I.GetString
(bData, 0, 30)
lval = BitConverter.To Int64(bData, 31)
Console.WriteLi ne(lval)
I want to put:
Dim bData As Byte() = New Byte(size)
but no luck.
Thanks,
Denis
Newbie here wondering how to initialize a byte array.
I'm working on the compact framework, and I keep getting
an error because the byte array is null.
Here is the code:
Dim ptr As IntPtr = DBAccessFuncDec l.GetLongVal()
Dim sval As String
Dim lval As Long
Dim size As Integer = 30 + 16
Dim bData As Byte()
***Marshal.Copy (ptr, bData, 0, size)*** HERE IS THE ERROR
sval = System.Text.ASC IIEncoding.ASCI I.GetString
(bData, 0, 30)
lval = BitConverter.To Int64(bData, 31)
Console.WriteLi ne(lval)
I want to put:
Dim bData As Byte() = New Byte(size)
but no luck.
Thanks,
Denis
Comment