CIcmpClient::GetHostAddress Method  
 
INT GetHostAddress(
  LPTSTR lpszHostAddress,  
  INT cbHostAddress  
);
INT GetHostAddress(
  CString& strHostAddress  
);

The GetHostAddress copies the IP address of the current host into the specified buffer as a string using dot-notation.

Parameters

lpszHostAddress
A pointer to the buffer that will contain the IP address of the current remote host in dot-notation. This buffer should be at least 16 characters in length.
cbHostAddress
The maximum number of characters that may be copied into the buffer, including the terminating null character character.

Return Value

If the method succeeds, the return value is the length of the address string. If the return value is zero, this indicates that no remote host has been specified. If the method fails, the return value is ICMP_ERROR. To get extended error information, call GetLastError.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools11.h
Import Library: csicmv11.lib
Unicode: Implemented as Unicode and ANSI versions

See Also

FormatAddress, GetHostName, ResolveAddress, SetHostAddress, SetHostName