The IDirectDraw2::Initialize method initializes the 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 the method fails, the return value may be 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) protocol. If the DirectDrawCreate function was used to create the DirectDraw object, this method returns DDERR_ALREADYINITIALIZED. If IDirectDraw2::Initialize is not called when using CoCreateInstance to create the DirectDraw object, any method that is called afterward returns DDERR_NOTINITIALIZED.
Remarks
For more information about using IDirectDraw2::Initialize with CoCreateInstance, see Creating DirectDraw Objects by Using CoCreateInstance.
QuickInfo
Windows NT: Use version 4.0 or later.
Windows: Use Windows 95 or later. Available as a redistributable for Windows 95.
Windows CE: Unsupported.
Header: Declared in ddraw.h.
Import Library: Use ddraw.lib.