| |
| 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 null-terminated 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 AF_INET, the address must be in IPv4 format, and if it
is AF_INET6, 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
Client: Requires Windows 7, Windows Vista or Windows
XP.
Server: Requires Windows Server 2008 or Windows Server
2003.
Header: Include cstools7.h.
Library: Use csdnsav7.lib.
Unicode: Implemented as Unicode and ANSI versions.
See Also
FormatAddress, GetHostAddress, GetHostInfo, GetHostServices, GetMailExchange, GetRecord, INTERNET_ADDRESS
|
|