Marshalling question

  • Thread starter Thread starter MyAlias
  • Start date Start date
M

MyAlias

Private Structure WCRANGE
Dim wcLow As Short
Dim cGlyphs As Short
End Structure

Private Structure GLYPHSET
Dim cbThis As Integer
Dim flAccel As Integer
Dim cGlyphsSupported As Integer
Dim cRanges As Integer
-> <MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst:=100)> Dim
ranges() As Integer
End Structure

what marshall parameters to use to declare
ranges() As WCRANGE
instead of
ranges() As Integer
in order to have EXACTLY the same memory contents?

Thanks for taking your time
 
Private Structure WCRANGE
Dim wcLow As Short
Dim cGlyphs As Short
End Structure

Private Structure GLYPHSET
Dim cbThis As Integer
Dim flAccel As Integer
Dim cGlyphsSupported As Integer
Dim cRanges As Integer
-> <MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst:=100)> Dim
ranges() As Integer
End Structure

what marshall parameters to use to declare
ranges() As WCRANGE
instead of
ranges() As Integer
in order to have EXACTLY the same memory contents?

Thanks for taking your time

The current marshaller does not support arrays of structs inside of
structs... So basically you can't substitue WCRANGE for Integer. You'll
have to use the Integer array and then break the integer down into two
shorts manually.

I need to see if the 2005 marshaller supports this...
 
Thanks for all your answers
and sorry to repeat the subject,
i started this thread before reading your answer to another thread
:)

I also hope that the 2005 NET supports much more stuff than the 2003
 
Back
Top