• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 

NrCommLib HID Not working in C++ Builder 2009 or 2010

Started by FrankT, July 23, 2011, 01:15:36 am

Previous topic - Next topic

FrankT

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,

FrankT

Roman Novgorodov

July 23, 2011, 05:59:58 am #1 Last Edit: July 23, 2011, 06:03:53 am by Roman Novgorodov
Hello

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:

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
        Memo1->Lines->Add(s);
}


Roman Novgorodov
DeepSoftware LLC
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.