Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: k doc
  Where is k doc?
 Chicago
 Illinois - United States
 k doc
 To: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 Tags
Subject: RE: ActiveX to detect if modem line in use?
Thread ID: 230567 Message ID: 230581 # Views: 26 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Active X Controls & OLE Automation
Date: Sunday, June 07, 2009 12:06:13 AM         
   


Hi Stefan,

Appreciate the quick reply. However, my computer is connected to the internet via LAN and also has a fax modem. When I run the code below, it simply states "LAN Connection available". I want to be able to communicate with the modem to see if there is a dail-tone available to send a fax.

Thanks

Keashdoc

> > Hi,
> >
> > I was wondering if there was any activex or Win32 API routine that will allow me to communicate with the computer fax-modem to see if the phone line is in use. Specifically, I want to make sure that the phone line is "available" and not in use before transmitting a fax via the computer.
> >
> Hi Keashdoc -
>
> Perhaps the InternetGetConnectedState() API function might help, see also InternetGetConnectedStateEx():
> http://www.news2news.com/vfp/
>
>
>
> #define INTERNET_CONNECTION_MODEM			1
> #define INTERNET_CONNECTION_LAN				2
> #define INTERNET_CONNECTION_PROXY			4
> #define INTERNET_CONNECTION_MODEM_BUSY		8
> #define INTERNET_RAS_INSTALLED				16
> #define INTERNET_CONNECTION_OFFLINE			32
> #define INTERNET_CONNECTION_CONFIGURED		64
> 
> CLEAR
> 
> LOCAL lnFlag
> lnFlag = 0
> 
> DECLARE Integer InternetGetConnectedState ;
> 	IN wininet.dll ;
> 	Integer@, ;
> 	Integer
> 
> IF InternetGetConnectedState(@lnFlag,0) = 0
> 	? "No connection at all"
> ELSE
> 	IF BITOR(m.lnFlag, INTERNET_CONNECTION_MODEM) = m.lnFlag
> 		? "Modem connection available"
> 	ENDIF
> 	IF BITOR(m.lnFlag, INTERNET_CONNECTION_LAN) = m.lnFlag
> 		? "LAN connection available"
> 	ENDIF
> 	IF BITOR(m.lnFlag, INTERNET_CONNECTION_OFFLINE) = m.lnFlag
> 		? "Connection is off-line"
> 	ENDIF
> ENDIF
> 

>
>
>
>
> hth
> -Stefan



COMPLETE THREAD
ActiveX to detect if modem line in use? Posted by k doc @ 6/6/2009 5:14:15 PM
RE: ActiveX to detect if modem line in use? Posted by Stefan Wuebbe @ 6/6/2009 7:14:17 PM
RE: ActiveX to detect if modem line in use? Posted by k doc @ 6/7/2009 12:06:13 AM
RE: ActiveX to detect if modem line in use? Posted by Jacek Kalucki @ 6/7/2009 1:19:03 AM
RE: ActiveX to detect if modem line in use? Posted by k doc @ 6/9/2009 2:57:32 PM
RE: ActiveX to detect if modem line in use? Posted by Ammar Hadi @ 6/7/2009 8:19:28 AM