I have a c++ native dll (NOT CLR) , that have callback to c# application.
All callbacks works except the following:

C++:

```
typedef int (__stdcall *TransmitBinaryMessageCallback)(GUID connectionID, byte data[], int data_size);

```

call :

```
GUID ClientID = { 0x12345678, 0xabcd, 0xef12, { 0xfe, 0xdc, 0xa9, 0x87, 0x65, 0x43, 0x21, 0x11 } };
byte arrayB[10] = {0x2,0x4,0x6,0x8,0xaa,0xbb,0xcc,0xdd,0xee,0xff};
transmitBINMessage(ClientID,arrayB,10);

```

C#

```
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
public delegate int TransmitBinaryMessageCallback(Guid ClientID,byte [] data,int data_size

public static int FuncTransmitBinaryMessageCallback(Guid ClientID, byte[] data, int data_size)
{
    try
    {
        System.Windows.Forms.MessageBox.Show("transmitBinaryMessageCallback: clientID=" + ClientID.ToString() + Environment.NewLine +
            "data=" + data.ToString() + Environment.NewLine +
            "data_size=" + data_size.ToString());
    }
    catch
    {
        return -1;
    }
    return 1;
}

```

I get only the first byte => 0x2

I tried also:

```
char[] arrayBytes = new char[data_size];
BinaryReader reader = new BinaryReader(new MemoryStream(data));
int i = reader.Read(arrayBytes, 0, data_size);

```

i = 0 :(

What i'm missing?

> 
> I could change in c++ from byte [] to char\* and in C# to string ->
>  this work. BUT i want byte array, why it not work?!
> 
> 
>