TP>I am interested in writing a PB application which will search for an
TP>installed modem and return the COM port, IRQ and Memory for any/ all
TP>modems connected to the system.
TP>Any suggestions would be appreciated...
I've been trying to achieve the ability to autodetect the modem myself. The
closest I've come is with the following code which relies on the PBWIZ
Library by Tom Hanlin and a combination of opening the ports like normal and
using on error. The problem is it doesn't work on everything. So I'm still
trying to refine my approach.
$INCLUDE "pbwiz.inc"
$LINK "pbwiz.pbl"
on error goto handler:
x = 10
for testnumber% = 1 to 4
TCInit testnumber%, ErrCode%
if ErrCode% > 0 then iterate
TCdone
if testnumber% = 1 then portnum$ = "Com1:"
if testnumber% = 2 then portnum$ = "Com2:"
if testnumber% = 3 then portnum$ = "Com3:"
if testnumber% = 4 then portnum$ = "Com4:"
open portnum$ as #1
locate x,20
PRINT "Modem detected on Com"; testnumber%
incr x,2
skip:
close
next testnumber%
if x = 10 then
locate x,20
print "Unable to locate any modems."
end if
MouseInit%
end
handler:
if err = 24 then
resume skip
else
print "Unexpected error #";err
end
end if
---
* SLMR 2.1a *
--- InterEcho 1.11
---------------
* Origin: The DataStream (Node 1), Peoria, IL (1:232/30)
|