DirectPlayCreate

HRESULT WINAPI DirectPlayCreate(LPGUID lpGUID,

LPDIRECTPLAY *lplpDP, IUnknown *pUnkOuter);

Creates an instance of a DirectPlay object.

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

CLASS_E_NOAGGREGATION

DPERR_EXCEPTION

DPERR_INVALIDPARAMS

DPERR_UNAVAILABLE

lpGUID

Address of the globally unique identifier (GUID) that represents the service provider that should be created.

lplpDP

Address of a pointer to be initialized with a valid DirectPlay interface. The application will need to use the QueryInterface method to obtain an IDirectPlay2 (Unicode strings) or IDirectPlay2A (ANSI strings) interface.

pUnkOuter

Address of the containing IUnknown interface. This parameter is provided for future compatibility with COM aggregation features. Presently, however, the DirectPlayCreate function returns an error if this parameter is anything but NULL.

This function attempts to initialize a DirectPlay object and sets a pointer to it if successful. Your application should call the DirectPlayEnumerate function immediately before initialization to determine what types of service providers are available (the DirectPlayEnumerate function fills in the lpGUID parameter of DirectPlayCreate).

This function returns a pointer to an IDirectPlay interface. The current interfaces for DirectX 3 are IDirectPlay2 and IDirectPlay2A, which need to be obtained through a call to the QueryInterface method on the IDirectPlay interface returned by DirectPlayCreate.