ThbComPort.Active
Unit: hbComm
 

This property indicates whether the ThbComPort component is enabled to send and receive data or not. If ThbComPort is used with a serial port and the ThbComPort.PortName property is set, it also indicates whether the communication port (handle) is opened or closed. If TThbComPort is used in conjunction with ThbTapiLine, the handle is opened and closed by the call.

Example 1:

procedure TForm1.hbTapiLine1Connected(Sender: ThbTapiLine; Call: ThbTapiCall);
begin
  Call.Comm.Enabled := True;
  if Call.Comm.Available then
  begin
    hbComPort1.Handle := Call.Comm.Handle;
    hbComPort1.Active := True;
  end;
end;

Example 2:

procedure TForm1.ButtonActivate(Sender: TObject);
begin
  hbComPort1.PortName := 'COM1';
  try
    hbComPort1.Active := True;
  except
    { handle errors }
  end;
end;

Availability

Design-Time: Read, Write / Run-Time: Read, Write

Declaration

property Active: Boolean;

See Also

ThbTapiLine.OnConnected, ThbComPort. OnReceive, ThbComPort.Write