Platform SDK: DirectX |
The IDirectPlay4::SendChatMessage method sends a text message to another player, a group of players, or all players. This method supports both Unicode (the IDirectPlay4 interface) and ANSI strings (the IDirectPlay4A interface). The player receiving the chat message is informed through a DPMSG_CHAT system message in the player's receive queue. This method must be used in a lobby session.
HRESULT SendChatMessage( DPID idFrom, DPID idTo, DWORD dwFlags, LPDPCHAT lpChatMessage );
Returns DP_OK if successful or one of the following error values:
DPERR_ACCESSDENIED |
DPERR_CONNECTIONLOST |
DPERR_INVALIDFLAGS |
DPERR_INVALIDPARAMS |
DPERR_INVALIDPLAYER |
This method returns DPERR_INVALIDPARAMS if the idTo ID is not a valid player or group. It returns DPERR_INVALIDPLAYER if the idFrom ID is not a valid player. It returns DPERR_ACCESSDENIED if the idFrom ID is not a local player.
This method facilitates player-to-player chatting within a lobby session where it is possible for different client applications to be connected. You must use this method in a lobby session. Use is optional in an application session.
The receiving player will receive a system message (idFrom = DPID_SYSMSG). The DPCHAT structure will specify which player the chat message came from.
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.