DirectDrawCreate

HRESULT DirectDrawCreate(GUID FAR * lpGUID,

LPDIRECTDRAW FAR * lplpDD,IUnknown FAR * pUnkOuter);

Creates an instance of a DirectDraw object.

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

DDERR_DIRECTDRAWALREADYCREATED

DDERR_GENERIC

DDERR_INVALIDDIRECTDRAWGUID

DDERR_INVALIDPARAMS

DDERR_NODIRECTDRAWHW

DDERR_OUTOFMEMORY

lpGUID

Address of the GUID that represents the driver to be created. NULL is always the active display driver.

lplpDD

Address of a pointer that will be initialized with a valid DirectDraw pointer if the call succeeds.

pUnkOuter

Allows for future compatibility with COM aggregation features. Presently, however, DirectDrawCreate will return an error if this parameter is anything but NULL.

This function attempts to initialize a DirectDraw object, then sets a pointer to the object if successful. Calling the IDirectDraw::GetCaps method immediately after initialization is advised to determine to what extent this object is hardware accelerated.