D
Denis C
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 = DBAccessFuncDecl.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.ASCIIEncoding.ASCII.GetString
(bData, 0, 30)
lval = BitConverter.ToInt64(bData, 31)
Console.WriteLine(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 = DBAccessFuncDecl.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.ASCIIEncoding.ASCII.GetString
(bData, 0, 30)
lval = BitConverter.ToInt64(bData, 31)
Console.WriteLine(lval)
I want to put:
Dim bData As Byte() = New Byte(size)
but no luck.
Thanks,
Denis