## CLoadDirectDraw Class

DirectShow™ must work on multiple platforms; in particular, it also runs on Microsoft® Windows NT® 3.51, which does not have DirectDraw® capabilities. The filters therefore cannot link statically to the DirectDraw library. To make the platform dependencies easier to handle, this class manages loading and unloading the library and creating the initial IDirectDraw interface.

Member Functions

Name | Description
CLoadDirectDraw | Constructs a CLoadDirectDraw object.
GetDirectDraw | Retrieves a pointer to the IDirectDraw interface.
IsDirectDrawLoaded | Verifies that DirectDraw is loaded.
IsDirectDrawVersion1 | Checks the version of DirectDraw installed on the current system.
LoadDirectDraw | Loads and initializes the DirectDraw library.
ReleaseDirectDraw | Releases the IDirectDraw interface.

###

CLoadDirectDraw::CLoadDirectDraw

CLoadDirectDraw Class

Constructs a CLoadDirectDraw object.

CLoadDirectDraw(void);

##### Return Values

No return value.

###

CLoadDirectDraw::GetDirectDraw

CLoadDirectDraw Class

Retrieves the DirectDraw interface.

LPDIRECTDRAW GetDirectDraw(void);

##### Return Values

Returns a pointer to the IDirectDraw interface.

##### Remarks

Call CLoadDirectDraw::LoadDirectDraw before calling this member function and call the CLoadDirectDraw::ReleaseDirectDraw member function to release the interface when you are done.

###

CLoadDirectDraw::IsDirectDrawLoaded

CLoadDirectDraw Class

Verifies that this object loaded DirectDraw.

HRESULT IsDirectDrawLoaded(void);

##### Return Values

Returns S_OK if loaded; otherwise, returns S_FALSE.

###

CLoadDirectDraw::IsDirectDrawVersion1

CLoadDirectDraw Class

Checks the version of DirectDraw installed on the current system.

BOOL IsDirectDrawVersion1(void);

##### Return Values

Returns TRUE if the installed version of DirectDraw doesn't support the IDirectDraw2 interface, or FALSE if the m_pDirectDraw data member is NULL or the installed version of DirectDraw supports IDirectDraw2.

##### Remarks

The video renderer must know what the installed version of DirectDraw is to perform certain tasks, such as full-screen playback, which the IDirectDraw2 interface supports.

###

CLoadDirectDraw::LoadDirectDraw

CLoadDirectDraw Class

Loads and initializes the DirectDraw library in the specified area.

HRESULT LoadDirectDraw(
LPSTR szDevice
);

##### Parameters

szDevice
  This parameter is optional; if omitted, this method loads DirectDraw to the base drawing area.

##### Return Values

Returns S_OK if DirectDraw loaded correctly or E_NOINTERFACE otherwise.

##### Remarks

DirectDraw is not always available, so applications can't statically link to the library. Therefore, this member function loads the library, gets the function entry point addresses, and calls them to create the driver objects. Call this member function before calling CLoadDirectDraw::GetDirectDraw to retrieve the IDirectDraw interface.

###

CLoadDirectDraw::ReleaseDirectDraw

CLoadDirectDraw Class

Releases the IDirectDraw interface.

void ReleaseDirectDraw(void);

##### Return Values

No return value.

##### Remarks

This member function is called to release any IDirectDraw interface previously loaded. Call this only when all reference counts have been released.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.