C
Christian Sebler
Hello
I have this Problem.
I implements the Interface ILockbytes (IStorage).
Take a look:
Public Function GetData(ByVal inILockBytes As ILockBytes)
Try
Dim statss As System.Runtime.InteropServices.STATSTG
inILockBytes.Stat(statss, 0)
!!This Works fine!!
Debug.WriteLine(statss.pwcsName)
!!This Works too!!
Debug.WriteLine(statss.cbSize.ToString)
!!This Works too!!
Debug.WriteLine(statss.type.ToString)
Dim sizee As Int32 = statss.cbSize
Dim nybytes As Byte() = New Byte(sizee) {}
Dim newptr As IntPtr = Marshal.AllocCoTaskMem(sizee)
!!This fails!!
reads = inILockBytes.ReadAt(0, newptr, sizee)
Marshal.Copy(newptr, nybytes, 0, sizee)
Marshal.FreeCoTaskMem(newptr)
....................
Have anywhere an Solution or an Sample or something else?
Christian
I have this Problem.
I implements the Interface ILockbytes (IStorage).
Take a look:
Public Function GetData(ByVal inILockBytes As ILockBytes)
Try
Dim statss As System.Runtime.InteropServices.STATSTG
inILockBytes.Stat(statss, 0)
!!This Works fine!!
Debug.WriteLine(statss.pwcsName)
!!This Works too!!
Debug.WriteLine(statss.cbSize.ToString)
!!This Works too!!
Debug.WriteLine(statss.type.ToString)
Dim sizee As Int32 = statss.cbSize
Dim nybytes As Byte() = New Byte(sizee) {}
Dim newptr As IntPtr = Marshal.AllocCoTaskMem(sizee)
!!This fails!!
reads = inILockBytes.ReadAt(0, newptr, sizee)
Marshal.Copy(newptr, nybytes, 0, sizee)
Marshal.FreeCoTaskMem(newptr)
....................
Have anywhere an Solution or an Sample or something else?
Christian