Developer asks:
I need to set the modem for the TAPI part of my application. I have my own
dialog and can't use your device box. So I attempted to retrieve
modems via Device, DeviceCount etc. According to Help, this list is
populated at nrCommTAPI constructor time. The DeviceCount is zero.
In addition is there an easier way to set the modem strictly based on it's
friendly name instead of searching for the name and using the index ?
Thanks
Bill
procedure TForm1.FormShow(Sender: TObject);
var
j: integer;
begin
with nrCommTAPI1 do
begin
Memo1.Lines.Clear;
for j := 0 to DeviceCount - 1 do
Memo1.Lines.Add(Device[j].NameFriendly);
end;
end;
You can call Update() method for reload Device List. See modified code:
procedure TForm1.FormShow(Sender: TObject);
var
j: integer;
begin
nrCommTAPI1.Update;
with nrCommTAPI1 do
begin
Memo1.Lines.Clear;
for j := 0 to DeviceCount - 1 do
Memo1.Lines.Add(Device[j].NameFriendly);
end;
end;