|
INT GetAddress( |
|
LPCTSTR lpszAddress, |
|
|
INT nAddressFamily, |
|
|
LPINTERNET_ADDRESS lpAddress |
|
); |
The GetAddress method converts an address string to a
numeric IPv4 or IPv6 address.
Parameters
- lpszAddress
- A pointer to a string which specifies an IPv4
address in dotted notation.
- nAddressFamily
- An integer value which specifies the type of IP address. If
this parameter is zero, the address family will be determined
automatically based on the format of the address string. If this
parameter is DNS_ADDRESS_IPV4, the address must be in IPv4 format,
and if it is DNS_ADDRESS_IPV6, the address must be in IPv6 format.
- lpAddress
- A pointer to an INTERNET_ADDRESS structure that will contain
the numeric form of the IPv4 or IPv6 address in network byte order
when the method returns.
Return Value
If the method succeeds, the return value is the address family for
the IP address. If the method fails, the return value is DNS_ERROR.
To get extended error information, call GetLastError.
Remarks
This method will only accept a string that is in the proper format
for an IP address, and cannot be used to resolve a host name. To
perform host name resolution, use the GetHostAddress method.
To convert a numeric address to an address string, use the
FormatAddress method.
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
FormatAddress,
GetHostAddress,
GetHostInfo,
GetHostServices,
GetMailExchange,
GetRecord,
INTERNET_ADDRESS
|
|