Index Topic Contents | |||
Previous Topic: IDirectPlay3::SetSessionDesc Next Topic: IDirectPlayLobby2 Interface |
IDirectPlay3::StartSession
IDirectPlay3 InterfaceUse this method to initiate the launch of a DirectPlay session. Call SetGroupConnectionSettings first to specify what application to launch, which service provider to use, and what session description to use.
When StartSession is called, each player in the group receives a DPMSG_STARTSESSION instructing the player to launch the session.
HRESULT StartSession(
DWORD dwFlags,
DPID idGroup
);Parameters
- dwFlags
- Not used. Must be zero.
- idGroup
- The DPID of the group to send start session commands to. The group must be a staging area.
Return Values
Returns DP_OK if successful or one of the following error values:
- DPERR_ACCESSDENIED
- DPERR_INVALIDFLAGS
- DPERR_INVALIDGROUP
- DPERR_INVALIDPARAMS
This method returns DPERR_INVALIDGROUP if the given group ID is not a valid staging area.
Remarks
A player joining a staging area group for which the session has already started can call this method to join the session. The player will receive a DPMSG_STARTSESSION message instructing it how to join the session.
You can determine if a session is already in progress by calling IDirectPlay3::GetGroupConnectionSettings and examining the guidInstance parameter it returns through a pointer in the DPLCONNECTION structure to the DPSESSIONDESC2 structure. If guidInstance is GUID_NULL, no session is in progress. If it is any other value, a session is already in progress.
See Also
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.