August 04, 2020, 10:36:10 am

News:

SMF - Just Installed!


Error by Read

Started by somnomedics, December 15, 2009, 01:48:05 pm

Previous topic - Next topic

somnomedics

My code:

void __fastcall TForm1::nrBT1Connect(TObject *Sender)  // OnConnect event
{
  if(nrBT1->DeviceIndex >= 0)
  {
    if(nrBT1->WaitForBytes(10,5000))
    {
      char buf[20];
      int i=nrBT1->ReadyForRead;  // ReadyForRead is 14
      nrBT1->Read(buf,i); // <---  error   "AccessViolation. Write of address 000000E.
    }
  }
}

Roman Novgorodov

Hello

Yes you are right. It is a bug. We will fix it in the new version.

Now you can access to incoming data in OnAfterReceive event handler only.

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