Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

New Developer
Posts: 7
Registered: ‎08-15-2012
My Device: Bold 9780
My Carrier: Fido

BbDevMgr UsbClient in C#

Hi all

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.