Microsoft DirectX 9.0 SDK Update (Summer 2003) |
IDirectPlay8AddressIP::BuildAddress Method
Builds a remote Microsoft® DirectPlay® Internet Protocol (IP) address from a host name and a port.
Syntax
HRESULT BuildAddress(
const WCHAR *const wszAddress, const USHORT usPort );
Parameters
- wszAddress
- [in] Remote host address can be a dotted Internet addressfor example, 127.0.0.1or a valid host namefor example, example.microsoft.com.
- usPort
- [in] Port on the remote host to which to connect.
Return Value
Returns S_OK if successful, or one of the following error values.
DPNERR_INVALIDPARAM One or more of the parameters passed to the method are invalid. DPNERR_INVALIDPOINTER Pointer specified as a parameter is invalid. DPNERR_NOTALLOWED This function is not allowed on this object.
Remarks
The result of a successful call is a valid remote address with the following elements.
All addressing information contained in the object before the call is erased.
- DPNA_KEY_PROVIDER = CLSID_DP8SP_TCPIP
- DPNA_KEY_HOSTNAME = specified host name
- DPNA_KEY_PORT = specified port
Note The DPNSVR is a DirectPlay feature that allows multiple processes to share a single port for enumeration. Do not use the DPNA_DPNSVR_PORT flag when constructing a device address, or when making a connection. This flag should only be used for enumerations. If you do not add a port element to the enumeration address, the port represented by the flag will be automatically added to that address. See Using the DirectPlay DPNSVR Application for a further discussion of DPNSVR.