Author Topic: NrCommLib HID Not working in C++ Builder 2009 or 2010  (Read 1337 times)


  • Newbie
  • *
  • Posts: 1
    • View Profile
NrCommLib HID Not working in C++ Builder 2009 or 2010
« on: July 23, 2011, 04:15:36 am »
Hello All,

I have installed NrCommLib 920 (Trial) on a machine that has C++ Builder Ver 6, Rad Studio 2009 and Rad Studio 2010 professional on it. The installation worked with no problems.

I tried compiling the HID Demo in C++ Builder Ver6 and the data that is returned from a 3DConnexion Space Explorer is correct. I then compiled the demo program using Delphi 2009 and Delphi 2010 and they too work correctly.

Unfortunately when I compile the BCB demo (same as BCB V.6) using C++ Builder 2009 or C++ Builder 2010 it looks like it's working but the data is absolutely wrong. It consistently gives the same data pattern regardless of what button is pressed or where the handle is moved to.

It could be related to the differences in Unicode between C++ Builder Ver 6 and 2009 and 2010 but with not having the Source, I cannot tell.

Will you be planning to release a version of this component (HID) that is compatible with 2009 and 2010 in the near future?

B.T.W. the version compilers I'm using are:
Embarcadero® RAD Studio 2010 Version 14.0.3615.26342 (the latest version of the English USA)
CodeGearâ„¢ RAD Studio 2009  Version 12.0.3420.21218 (also the last version here in the states)

Best Regards,


Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 1008
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: NrCommLib HID Not working in C++ Builder 2009 or 2010
« Reply #1 on: July 23, 2011, 08:59:58 am »

Thank you for your information.

You report that HIDDemo works properly in Delphi 2009 and Delphi 2010 and in BCB6.
It seems like HIDDemo works non correct in CB 2009 and CB 2010.

Component code is same for all delphi cb and rafs.

Please try to modify HIDDemo (for C++Builder) sources:

Code: [Select]
void __fastcall TForm1::nrHid1AfterReceive(TObject *Com, Pointer Buffer,
      DWORD Received)
        AnsiString s = "HID Report is received: " + IntToStr(Received) + " bytes ";
        for(int i = 0; i < (int)Received; i++)
                s += IntToHex(Byte(PAnsiChar(Buffer)[i]),2) + " ";  // <------ !!!!!!!!! change PChar on PAnsiChar pointer

Roman Novgorodov
DeepSoftware LLC
« Last Edit: July 23, 2011, 09:03:53 am by Roman Novgorodov »
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.