?/TD>
Microsoft DirectX 9.0

IDirectPlay8LobbyClient::Initialize Method


Registers an entry point in the lobby client's code that receives notifications on changes of state for any launched applications. The message handler also receives messages from the lobbied application. This method must be called before calling any other methods of this interface.

Syntax

HRESULT Initialize(      

    const PVOID pvUserContext,     const PFNDPNMESSAGEHANDLER pfn,     const DWORD dwFlags );

Parameters

pvUserContext
[in] Pointer to the user-provided context value provided in calls to the message handler. Providing a user-context value is useful to differentiate messages from multiple interfaces to a common message handler.
pfn
[in] Pointer to a PFNDPNMESSAGEHANDLER callback function that receives all messages from the IDirectPlay8LobbyClient interface and indications of session changes from the IDirectPlay8LobbiedApplication interface.
dwFlags
[in] The following flag can be specified.
DPLINITIALIZE_DISABLEPARAMVAL
Disables parameter validation.

Return Value

Returns S_OK if successful, or one of the following error values.

DPNERR_ALREADYINITIALIZEDThe object has already been initialized.
DPNERR_INVALIDFLAGSThe flags passed to this method are invalid.
DPNERR_INVALIDPARAMOne or more of the parameters passed to the method are invalid.
DPNERR_NOTALLOWEDThis function is not allowed on this object.


Remarks

Call this is method first after using CoCreateInstance to obtain the IDirectPlay8LobbyClient interface.

Note  Only one instance of IDirectPlay8LobbyClient and IDirectPlay8LobbiedApplication is allowed to be running for each process.


© 2002 Microsoft Corporation. All rights reserved.