CSocketWrench::CompareAddress Method  
 
BOOL CompareAddress(
  LPINTERNET_ADDRESS lpAddress1,  
  LPINTERNET_ADDRESS lpAddress2  
);
BOOL CompareAddress(
  LPCTSTR lpszAddress1,  
  LPCTSTR lpszAddress2  
);

Compare two IP addresses to determine if they are identical.

Parameters

lpAddress1
A pointer to an INTERNET_ADDRESS structure that contains the first IP address to be compared. An alternate version of this method accepts a string that specifies the IP address to be compared.
lpAddress2
A pointer to an INTERNET_ADDRESS structure that contains the second IP address to be compared. An alternate version of this method accepts a string that specifies the IP address to be compared.

Return Value

If the method succeeds and the two addresses are identical, the return value is non-zero. If the method fails or the two addresses are not identical, the return value is zero. If either parameter is NULL, or the address family for the two addresses are not the same, the last error code will be updated. If the addresses are valid and in the same address family, but are not identical, the last error code will be set to NO_ERROR.

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

See Also

GetHostAddress, GetLocalAddress, GetPeerAddress, INTERNET_ADDRESS