11-25-2012 05:29 PM
I want to convert C++ code of USBClient (provided by RIM which works with BbDevMgr) to C#.
I've imported COM component of BbDevMgr in my project and reproduced the code on C#.
Everything is fine until I have to read a message from BB device..
Here is the scenario :
In C++ code to receive a message is used this function :
_channel->ReadPacket( unsigned char * data, long len, long *actual )
So the same function in C# looks like this :
channel.ReadPacket(out byte data, int length, out int actual)
And here the problem comes.
In C++ in the 'data' parameter we can store a whole sentence from device, which is fine, but in C# we can receicve only 1 byte, which is only 1 char.. which should be byte array (byte[ ]) instead of one byte.
Starting from here, could you explain what I'm doing wrong and how can I achive same functionality in C# as in C++.
Thank you in advance for any help.