Using Marshal to create an unmanaged UInt32 array

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gareth

    Using Marshal to create an unmanaged UInt32 array

    If I want to move a signed integer array to unmanaged memory I can use
    the following code:

    Dim myArray() As Integer
    Dim myPtr As IntPtr

    myPtr = Marshal.AllocHG lobal(Marshal.S izeOf(GetType(I nteger)) *
    myArray.Length)
    Marshal.Copy(my Array, 0, myPtr, myArray.Length)

    However I cannot use Marshal.Copy for an array of UInt32

    How can I achieve this? (OpenGL doesnae like signed buffer
    indices ;) )

    Many thanks,

    G
Working...