InetGetHostAddress
DWORD InetGetHostAddress(
LPCTSTR lpszHostName  
);

The InetGetHostAddress function returns the numeric IP address of the specified host.

Parameters

lpszHostName
A pointer to the name of the host to resolve; this may be a fully-qualified domain name, or an IP address.

Return Value

If the function succeeds, it returns the 32-bit integer representation of the IP address. If the function fails, the return value is INET_ADDRESS_NONE. To get extended error information, call InetGetLastError.

Remarks

This function can also be used to convert an address in dot notation to a numeric IP address. If the library must perform a DNS lookup to resolve the hostname, the calling thread will block.

Requirements

Client: Requires Windows Vista, Windows XP or Windows 2000 Professional.
Server: Requires Windows Server 2008, Windows Server 2003 or Windows 2000 Server.
Header: Include cswsock6.h.
Library: Use cswskav6.lib.
Unicode: Implemented as Unicode and ANSI versions.

See Also

InetGetHostName, InetGetLocalAddress, InetGetLocalName, InetGetPeerAddress


Copyright © 2008 Catalyst Development Corporation. All rights reserved.