CUT_RAS::IsConnected

Dundas

CUT_RAS::IsConnected

Members | Overview

BOOL IsConnected()

Return Value

Returns TRUE if connected, otherwise it returns FALSE.

Remarks

Call this function to check the state of the current connection. If the connection is still good then TRUE is returned but if the connection has been terminated FALSE is returned.

This function is useful for monitoring a connection throughout its lifetime, since disconnections are quite common for a variety of reasons (ISP timeouts, voice priority over data on busy phone lines, noisy phone lines, etc.).

 Example

// update the connection status of this application's instance of the RAS connection

void CTestAppDlg::OnTimer(UINT nIDEvent)

{

CString strStatus;

// check if we are connected

if (m_ras.IsConnected())

strStatus = "Connected";

else

strStatus = "Disconnected";

SetDlgItemText(IDC_STATUS,strStatus);

CDialog::OnTimer(nIDEvent);

}