34. FAQ o Win API

Q> How to define, whether there is a connection on RAS? 
A> 

BOOL IsInternetConnected () 
{ 
DWORD nRasDevices = 20; 
DWORD nSize = 20; 

RASCONN rasconnected [10];//Ras Connected struct 

rasconnected [0].dwSize = sizeof (RASCONN); 
RasEnumConnections (rasconnected, &nSize, &nRasDevices); 

return (BOOL (nRasDevices)); 
}
Note:Win95 (Unlike NT) considers that connection happened, as soon as the modem подымает a pipe ;-) 


2000 (c) DM