Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Visual Basic
Expertise: Beginner
Aug 22, 1997



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Track Modem Use by Other Applications

With applications increasingly using modems, it is quite possible that users will start your application, forgetting that another application is already using the modem-like a fax machine, for example. The MS Comm object that comes with VB has a PortOpen property that returns the state of the modem. However, this property seems to work only when the modem is opened by the VB application in which the command is issued. Otherwise, PortOpen returns False even if, for example, a fax machine is running and is holding the modem port open to monitor incoming faxes. If you try to open the port, it will cause an error message. The only solution is to make an error-handling routine that detects if the port is open by provoking the error and handling it. In the handling routine, insert a MsgBox that tells the user to check for other applications and waits for an answer before resuming.
Eric Bernatchez
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date