IDirectPlayLobby::ReceiveLobbyMessage

HRESULT ReceiveLobbyMessage(DWORD dwFlags,

DWORD dwAppID, LPDWORD lpdwMessageFlags,

LPVOID lpData, LPDWORD lpdwDataSize);

Retrieves the message sent between a lobby client application and a DirectPlay application. Messages are queued, so there is no danger of losing data if it is not read in time.

·Returns DP_OK if successful, or one of the following error values otherwise:

DPERR_APPNOTSTARTED

DPERR_BUFFERTOOSMALL

DPERR_GENERIC

DPERR_INVALIDINTERFACE

DPERR_INVALIDOBJECT

DPERR_INVALIDPARAMS

DPERR_NOMESSAGES

DPERR_OUTOFMEMORY

dwFlags

Reserved; must be zero.

dwAppID

Identifies which application's message to retrieve when called from a lobby client (that communicates with several applications). When called from an application (that communicates only with one lobby client), this parameter must be set to zero. This ID number is obtained by using the IDirectPlayLobby::RunApplication method.

lpdwMessageFlags

Flags indicating what type of message is being returned.

DPLAD_SYSTEM

Indicates that this is a system message informing the application of an event. To determine what type of event occurred, cast the lpData pointer to the DPLMSG_GENERIC system message and switch on the dwType member to see exactly what type of system message it is.

lpData

Address of a buffer in which the message is to be written. Set this parameter to NULL to request only the size of message. The lpdwDataSize parameter will be set to the minimum size required to hold the message.

lpdwDataSize

Address of a variable that is initialized to the size of the buffer before calling this method. After the method returns, this parameter will be set to the size, in bytes, of the message. If the buffer was too small (DPERR_BUFFERTOOSMALL), then this parameter will be set to the minimum buffer size required.