The IDirectDraw2::Initialize method initializes the DirectDraw object that was created by using the CoCreateInstance COM function.
HRESULT Initialize(
GUID FAR *lpGUID
);
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.
For more information about using IDirectDraw2::Initialize with CoCreateInstance, see Creating DirectDraw Objects by Using CoCreateInstance.