DirectX SDK

DirectPlay4.SetPlayerName

The DirectPlay4.SetPlayerName method changes the formal and friendly names of a local player. Only the computer that created the player can change the name.

object.SetPlayerName(playerId As Long, _ 
  friendlyName As String, _ 
  formalName As String, _ 
  flags As CONST_DPSETFLAGS) 

Parameters

object
Object expression that resolves to a DirectPlay4 object.
playerId
ID of the local player for which data is being sent.
friendlyName
Friendly ("short") name of the player.
formalName
Formal ("long") name of the player.
flags
Flag from the CONST_DPSETFLAGS enumeration indicating how the name will be propagated.

Error Codes

If the method fails, an error is raised and Err.Number may be set to one of the following values:

DPERR_ACCESSDENIED
DPERR_CONNECTIONLOST
DPERR_INVALIDOBJECT
DPERR_INVALIDPLAYER

Remarks

A DPSYS_SETPLAYERORGROUPNAME system message will be sent to all the other players notifying them of the change unless DPSESSION_NODATAMESSAGES is set in the session description.

See Also

DirectPlay4.GetPlayerFriendlyName, DirectPlay4.GetPlayerFormalName