arrays

  • Thread starter Thread starter xontrn
  • Start date Start date
X

xontrn

Hello,

I am building a .net control in C++/CLI, and it will be hosted by a C#
form. The form will load some data from file and pass it to the
control (an array of bytes):

byte[] data = new byte[length];

.... // load the data from file

mMyControl.Load(data, length); // pass data into the control

My question is, what would the declaration of Load look like?

Is it just

void Load(array<byte>^ data, int length); ??

Or do I need to use System::Array or something?
 
Hello,

I am building a .net control in C++/CLI, and it will be hosted by a C#
form. The form will load some data from file and pass it to the
control (an array of bytes):

byte[] data = new byte[length];

... // load the data from file

mMyControl.Load(data, length); // pass data into the control

My question is, what would the declaration of Load look like?

Is it just

void Load(array<byte>^ data, int length); ??

cli::array<System::Byte>^ is correct for the first parameter

I doubt you want to pass the array and length though, either you want the
whole array and the length is passed implicitly, or else a subset in which
case you need array, starting offset, and count.
 
Back
Top