ThbTapiLine.PermanentDeviceID
Unit: hbTapi
 

The permanent device id is an identifier by which the device is known in the system's configuration. It is a permanent name for the line device. This permanent name (as opposed to DeviceID) does not change as lines are added or removed from the system, and persists through operating system upgrades. It can therefore be used to link line-specific information in .ini files (or other files) in a way that is not affected by adding or removing other lines or by changing the operating system.

Your application can use the PermantDeviceID to store an users configuration of the line device. You should not use the DeviceID to do so, because it could change in due to installing/removing TAPI-devices. Best is to use the PermanentDeviceId together with the DeviceName to store a line configuration. So you are able to check whether a device is exactly the one, the configuration is for.

The PermanentDeviceID can be used to handle the problem of identical device names within the device list.

You are able to use this property instead of the DeviceID or DeviceName property to select a line device.

When the PermanentDeviceId is set, other properties will be updated too. If the PermanentDeviceID is a valid one (a fitting device was found), the Available property is set to true, DeviceID holds the id and the DeviceName holds the name of the device.

Example

hbTapiLine1.PermanentDeviceID := PermanentDeviceIDFromIniFile;
if hbTapiLine1.Available then
begin
  ListBox1.Items.Add(hbTapiLine1.DeviceName + ' is still available');
  ListBox1.Items.Add('The DeviceID is now ' + IntToStr(hbTapiLine1.DeviceID));
end;

Availability

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

Declaration

property PermanentDeviceID: DWord;

Remarks

If the device is active prior to setting the PermanentDeviceID, then you must deactivate the component (ThbTapiLine.Active := False) otherwise an exception will be raised.

The PermanetDeviceID property is equal the PermenentLineID within in the lines Caps property.

See Also

ThbTapiLine.DeviceName, ThbTapiLine.DeviceID, ThbTapiLine.Available