CUT_RAS::GetEntryUserName

Dundas

CUT_RAS::GetEntryUserName

Members | Overview

int GetEntryUserName(LPCSTR szEntryName,LPSTR szUserName, long nMaxLen)

Parameters

szEntryName

Phonebook entry to retrieve the username from.

szUserName

Pointer to a string buffer that will store the retrieved username value.

nMaxLen

Length of the szUserName buffer.

Return Value

UTE_SUCCESS

Operation completed successfully.

UTE_ERROR

Function failed (see GetLastRASError for more details).

UTE_BUFFER_TOO_SHORT

The username string is larger than the specified nMaxLen parameter.

UTE_RAS_LOAD_ERROR

Unable to load the RAS DLLs.

Remarks

Returns the main phonebook's username for the given phonebook entry. This function reduces the amount of work required to retrieve a username compared to using the GetEntryProperties function directly.

See also: GetEntryProperties GetEntryPassword 

Example

 

// retrieve username for the specified phonebook entry

char szTemp[ ]

if (m_pRas->GetEntryUserName(m_szEntryName, szTemp,sizeof(szTemp)) == UTE_SUCCESS)

{

SetDlgItemText(IDC_USER,szTemp);

}