DirectX SDK |
The DirectPlay4.SendChatMessage method sends a text message to another player, a group of players, or all players. The player receiving the chat message is informed through a DPSYS_CHAT system message in the player's receive queue. This method must be used in a lobby session.
object.SendChatMessage(fromPlayerId As Long, _ toPlayerId As Long, _ flags As CONST_DPSENDFLAGS, _ message As String)
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_INVALIDFLAGS |
DPERR_INVALIDPARAMS |
DPERR_INVALIDPLAYER |
This method returns DPERR_INVALIDPARAMS if the toPlayerId ID is not a valid player or group. It returns DPERR_INVALIDPLAYER if the fromPlayerId ID is not a valid player. It returns DPERR_ACCESSDENIED if the fromPlayerId ID is not a local player.
This method facilitates player-to-player chatting within a lobby session where different client applications can be connected. In an application session, chat messages can be sent by using the DirectPlay4.Send method.
The receiving player will receive a system message (fromPlayerId = DPID_SYSMSG).