ThbTapiLine.DeviceID
Unit: hbTapi
 

Set this property to indicate which line device should be used. All available devices are listed in the DeviceList property. Legal values for this property are 0 to ThbTapiLine.DeviceList.Count -1. The DeviceName property is set to the corresponding name.

Your application should not save the DeviceID to restore an user sphone configuration because it could change in due to installing/removing TAPI-devices. The better choice is to store the DeviceName. The PermanentDeviceID can be used to handle the problem of identical device names.

The DeviceList property is of type TStrings. The TStrings.Objects property is used the store the DeviceID together with the device name. So you are able to assign this list to a ComboBox, sort the list and get the DeviceID back by type-casting the Objects propertiy to Integer. Do not sort the ThbTapiLine.DeviceList, use always a copy to do so.

Example

for i := 0 to hbTapiLine1.DeviceList.Count-1 do
begin
  hbTapiLine1.DeviceID := i;
  if hbTapiLine1.Available then
  begin
    ListBox1.Items.Add(hbTapiLine1.DeviceName + ' is available');
  end;
end;

Availability

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

Declaration

property DeviceID: Integer;

Remarks

If the device is active prior to setting the DeviceID, then you must deactivate the component (ThbTapiLine.Active := False) otherwise an exception will be raised. Your application should not save the DeviceID to restore an users configuration because it could change in due to installing/removing TAPI-devices. The better choice is to store the DeviceName.

See Also

ThbTapiLine.DeviceName | DeviceList | Available