• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 
April 25, 2024, 01:44:58 pm

News:

SMF - Just Installed!


Device Count is ZERO

Started by Roman Novgorodov, January 31, 2008, 07:58:33 am

Previous topic - Next topic

Roman Novgorodov

January 31, 2008, 07:58:33 am Last Edit: January 31, 2008, 08:05:16 am by Roman Novgorodov
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;
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

Roman Novgorodov

January 31, 2008, 08:02:03 am #1 Last Edit: January 31, 2008, 08:04:56 am by Roman Novgorodov
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;
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.