?/TD>
Microsoft DirectX 9.0

IDirectPlay8ThreadPool::Initialize Method


Initializes the thread pool interface for the process.

Syntax

HRESULT Initialize(      

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

Parameters

pvUserContext
[in] User context for all message callbacks.
pfn
[in] Pointer to a PFNDPNMESSAGEHANDLER function to handle thread pool messages.
dwFlags
[in] The following flag can be specified.
DPNINITIALIZE_DISABLEPARAMVAL
Disables parameter validation.

Return Value

Returns DPN_OK if successful. Otherwise, returns one of the following errors.

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

Only one IDirectPlay8ThreadPool object is allowed in a process. DPNERR_ALREADYINITALIZED is returned if IDirectPlay8ThreadPool::Initialize is called on a second IDirectPlay8ThreadPool object.

If a Microsoft?DirectPlay?object has already created threads, the IDirectPlay8ThreadPool object cannot be initialized. If the IDirectPlay8ThreadPool object has not been initialized, DPNERR_NOTALLOWED will be returned.



© 2002 Microsoft Corporation. All rights reserved.