CDnsClient::FormatAddress Method  
 
INT FormatAddress(
  LPINTERNET_ADDRESS lpAddress,  
  LPTSTR lpszAddress,  
  INT nMaxLength  
);
INT FormatAddress(
  LPINTERNET_ADDRESS lpAddress,  
  CString& strAddress  
);

The FormatAddress method converts a numeric IPv4 or IPv6 address to a string.

Parameters

lpAddress
A pointer to an INTERNET_ADDRESS structure which specifies the numeric IPv4 or IPv6 address to be converted into a string.
lpszAddress
A pointer to a null-terminated array of characters which will contain the converted IPv4 address in dot-notation. This string should be at least 16 characters in length. If the Microsoft Foundation Classes are being used, the second form of this method may be called where a CString object is specified instead.
nMaxLength
The maximum number of characters which may be copied in to the string buffer.

Return Value

If the method succeeds, the return value is the length of the string buffer. If the method fails, the return value is zero. 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: cstools10.h
Import Library: csdnsv10.lib
Unicode: Implemented as Unicode and ANSI versions.

See Also

GetAddress, GetHostAddress, GetHostInfo, GetHostServices, GetMailExchange, GetRecord, INTERNET_ADDRESS