Platform SDK: DirectX

DirectPlayLobby3.ReceiveLobbyMessage

The DirectPlayLobby3.ReceiveLobbyMessage method 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.

object.ReceiveLobbyMessage(applicationId As Long, _
    messageFlags As Long) As DirectPlayMessage 

Parameters

object
Object expression that resolves to a DirectPlayLobby3 object.
applicationId
Identifier of the application from which to receive a message. When called from a lobby client (communicating with several applications), this ID number is the one obtained from the DirectPlayLobby3.RunApplication method. When called from an application (communicating only with one lobby client), this parameter must be set to 0.
messageFlags
A variable to receive flags from the CONST_DPLMSG enumeration indicating what type of message is being returned. The default (messageFlags = 0 or DPLMSG_USERDEFINED) indicates that the message is custom-defined by the sender. Processing of this type of message is optional. The receiver must interpret this message based on the identity of the sending application. A lobby can identify the sending application based on the GUID of the application that was launched. An application has to identify the lobby by sending the lobby a standard message requesting an identifying GUID.

Return Values

If the method succeeds, it returns a DirectPlayMessage object whose methods can be used to extract the message data, or Nothing if there are no messages pending.

Error Codes

If the method fails, an error is raised and Err.Number may be set to one of the following values:

DPERR_APPNOTSTARTED
DPERR_GENERIC
DPERR_INVALIDINTERFACE
DPERR_INVALIDOBJECT
DPERR_INVALIDPARAMS
DPERR_OUTOFMEMORY

See Also

DirectPlayLobby3.SendLobbyMessage