CUT_RAS::GetConnection

Dundas

CUT_RAS::GetConnection

Members | Overview

int GetConnection(LPRASCONN rc,DWORD index)

Parameters

rc

A pointer to an existing RASCONN structure.

index

A zero-based index (0 to (GetConnectionCount()-1) ), specifying the RAS connection from which information will be retrieved.

Return Value

UTE_SUCCESS

Operation completed successfully.

UTE_ERROR

An error occurred and there is no data to return.

UTE_INDEX_OUTOFRANGE

The given index does not point to a valid RASCONN entry.

UTE_RAS_LOAD_ERROR

Unable to load the RAS DLLs.

Remarks

Call this function to fill in the given RASCONN structure with the connection information for the specified running connection. A RASCONN structure contains the phonebook entry's name as well as the device's type and name.

Refer to the MSDN library for more information on RASCONN structures.

See also: GetConnectionCount

Example

//retrieves and shows connection information for all running connections

CComboBox* cb3 = (CComboBox*)GetDlgItem(IDC_COMBO3);

m_ras.EnumConnections();

int cnt = m_ras.GetConnectionCount();

RASCONN rc;

for(x = 0; x < cnt; x++){

  m_ras.GetConnection(&rc,x);

  cb3->AddString(rc.szEntryName);

}

cb3->SetCurSel(0)