Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to determine modem comm port number
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00460387
Message ID:
00460390
Views:
13
>I have commtools. It requires a com port number. Does anyone know how to get this from the user's computer without having to have a control file that has to be maintained?

Look in the FAQ - I posted code that will return the identity of all COM ports available to the MSCOMM32 control; you could use that information to then spin through the available COM ports looking for a modem by sending a control sequence and waiting for a possible modem to respond. There's no guarentee that a modem will be available, that it'll be able to get on line, and you need to know the control sequences for the modem; even if a modem responds, there's no certainty that it's connected to a phone line. The code I posted will reliably locate standard COM ports between 1 and 16 at standard addresses. It's extremely likely that if you find a modem on other than COM1-4, it's going to have customized IRQ and IO port identifiers associated with it, especially with PnP PCI or PC Card (CardBus) modems.

You may want to examine the HKEY_LOCAL_MACHINE\Hardware\DEVICEMAP registry hive for information on possible modem devices, whiuch could be in a number of subkeys; the most common one is SERIALCOMM, but others are possible, especially with PC Card/CardBus modems.

If you were not using CommTools, I'd suggest using a TAPI control that handles the issues of identifying available TAPI devices and providing a virtualized interface to the TAPI device, but that might not be what you're looking to do.

In general, writing detailed modem handling in VFP apps is not a very cost-effective approach in most cases; adding a third-party ActiveX control with the required capabilities or accessing another app for the communications such as PCAnywhere32 that has scripting, a high-level view of the comm port, file transfer capabilties and the like is usually a better solution, but it's your app and you've given no indication of what needs to be done.

I have no idea regarding how to do the equivalent using CommTools.

In general, I'd recommend using a configuration file or entries in the registry to specify the modem; you need to know more than just a port ID in the vast majority of cases.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform