CSocketWrench::GetNextAlias Method  
 
BOOL GetNextAlias(
  LPTSTR lpszHostAlias,  
  INT nMaxLength  
);
BOOL GetNextAlias(
  CString& strHostAlias  
);

The GetNextAlias method returns the next alias for the host name specified in the call to GetFirstAlias.

Parameters

lpszHostAlias
A string buffer which will contain the next alias for the specified host name. This string should be at least 64 bytes in length. This argument may also reference a CString object which will contain the host alias when the method returns.
nMaxLength
Maximum number of characters that can be copied into the lpszHostAlias string buffer, including the terminating null byte.

Return Value

If the method succeeds, the return value is non-zero. If the method fails, the return value is zero. To get extended error information, call GetLastError.

Example

CSocketWrench sockClient;
CString strHostAlias;
BOOL bResult;

m_ctlListBox.ResetContent();

bResult = sockClient.GetFirstAlias(m_strHostName, strHostAlias);
if (bResult == FALSE)
{
    sockClient.ShowError();
    return;
}

while (bResult)
{
    m_ctlListBox.AddString(strHostAlias);
    bResult = sockClient.GetNextAlias(strHostAlias);
}

Requirements

Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header: Include cswsock10.h
Import Library: cswskv10.lib
Unicode: Implemented as Unicode and ANSI versions.

See Also

GetFirstAlias, GetHostAddress, GetHostName