Platform SDK: DirectX

IDirectDraw7::Initialize

The IDirectDraw7::Initialize method initializes a DirectDraw object that was created by using the CoCreateInstance COM function.

HRESULT Initialize(
  GUID FAR *lpGUID  
);

Parameters

lpGUID
Address of the globally unique identifier (GUID) used as the interface identifier.

Return Values

If the method succeeds, the return value is DD_OK.

If it fails, the method can return one of the following error values:

DDERR_ALREADYINITIALIZED
DDERR_DIRECTDRAWALREADYCREATED
DDERR_GENERIC
DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DDERR_NODIRECTDRAWHW
DDERR_NODIRECTDRAWSUPPORT
DDERR_OUTOFMEMORY

This method is provided for compliance with the Component Object Model (COM). If the DirectDrawCreate function was used to create a DirectDraw object, this method returns DDERR_ALREADYINITIALIZED. If IDirectDraw7::Initialize is not called when using CoCreateInstance to create a DirectDraw object, any method that is called afterward returns DDERR_NOTINITIALIZED.

Remarks

For more information about using IDirectDraw7::Initialize with CoCreateInstance, see Creating DirectDraw Objects by Using CoCreateInstance.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 98.
  Header: Declared in ddraw.h.