IDirectPlay8Peer::GetPeerAddress Method

DirectPlay

 
Microsoft DirectX 9.0 SDK Update (Summer 2003)

IDirectPlay8Peer::GetPeerAddress Method


Retrieves the address for the specified remote player in the session.

Syntax

HRESULT GetPeerAddress(      
    const DPNID dpnid,     IDirectPlay8Address **const pAddress,     const DWORD dwFlags );

Parameters

dpnid
[in] Variable of type DPNID specifying the identification of the player.
pAddress
[out] Address of a pointer to an IDirectPlay8Address object that specifies the address of the peer. You must release this object when you no longer need it.
dwFlags
[in] Reserved. Must be 0.

Return Value

Returns S_OK if successful, or one of the following error values.

DPNERR_INVALIDOBJECTThe Microsoft® DirectPlay® object pointer is invalid.
DPNERR_INVALIDPLAYERThe player ID is not recognized as a valid player ID for this game session.
DPNERR_INVALIDPARAMOne or more of the parameters passed to the method are invalid.
DPNERR_INVALIDPOINTERPointer specified as a parameter is invalid.
DPNERR_UNINITIALIZEDThe requested object has not been initialized.

Remarks

This method cannot be used to retrieve the address of the local player. If the player calls this method on his or her own identifier (ID), it returns a DPNERR_INVALIDPLAYER error message.

Use IDirectPlay8Peer::GetLocalHostAddresses to retrieve addresses that can be used to connect to the session.



© 2003 Microsoft Corporation. All rights reserved.