Platform SDK: DirectX |
The IDirectPlay4::GetPlayerAddress method retrieves the DirectPlay address for a player.
The DirectPlay address is a network address for a player using a specific service provider. You should call the IDirectPlayLobby3::EnumAddress method to parse the buffer retrieved by IDirectPlay4::GetPlayerAddress.
If this method is called on a local player, it returns the network address of the computer if it is available. In some cases, more than one address can be returned (for example, with TCP/IP where the computer has both a network card and a dial-up Internet connection).
HRESULT GetPlayerAddress( DPID idPlayer, LPVOID lpData, LPDWORD lpdwDataSize );
Returns DP_OK if successful, or one of the following error values otherwise:
DPERR_BUFFERTOOSMALL |
DPERR_INVALIDOBJECT |
DPERR_INVALIDPARAMS |
DPERR_INVALIDPLAYER |
DPERR_UNAVAILABLE |
This method returns DPERR_UNAVAILABLE if the address for the requested player ID is not available.
To get a list of valid modem choices, pass in 0 for the idPlayer parameter. A list of modem choices will be returned as a list of ANSI or Unicode strings with a zero-length string at the end.
The DirectPlay address will contain both ANSI and Unicode strings with the address, regardless of what interface this method is called on.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in dplay.h.
Import Library: Use dplayx.lib.