Associates an application-specific data block with a group ID. Only the computer that created the group can change the remote data associated with it.
HRESULT SetGroupData(
DPID idGroup,
LPVOID lpData,
DWORD dwDataSize,
DWORD dwFlags
);
Returns DP_OK if successful, or one of the following error values otherwise:
DirectPlay can maintain two types of group data: local and remote. Local data is available only to the application on the local computer. Remote data is propagated to all the other applications in the session. A DPSYS_SETPLAYERORGROUPDATA system message will be sent to all the other players notifying them of the change unless DPSESSION_NODATAMESSAGES is set in the session description. It is safe to store pointers to resources in the local data; the local data block is available (in the DPMSG_DESTROYPLAYERORGROUP system message) when the group is being destroyed, so the application can free those resources. For a list of system messages, see Using System Messages.
This method should not be used for updating real-time information (such as position updates) due to the overhead introduced. It is much more efficient to use IDirectPlay3::Send for this. IDirectPlay3::SetGroupData is more appropriate for shared state information that doesn't change very often and is not time critical (such as a team color).
DPMSG_SETPLAYERORGROUPDATA, IDirectPlay3::GetGroupData, IDirectPlay3::Send
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.