Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This method passes the IDirectDrawinterface to a loaded driver.

Syntax

HRESULT SetDirectDraw(
  LPDIRECTDRAW 
pDirectDraw 
);

Parameters

pDirectDraw

IDirectDrawinterface to be passed.

Return Value

Returns an HRESULTvalue.

Remarks

To have the renderer release a DirectDraw interface previously passed in through SetDirectDraw, an application can call SetDirectDrawand pass in NULL. However, the renderer continues using that DirectDraw interface until it is disconnected.

Therefore, calling SetDirectDrawwith a null parameter does not make the renderer stop using it immediately.

This method was created because only one instance of IDirectDrawcould be loaded per process in DirectDraw 1.0.

If an application wanted to load IDirectDrawbut allow the renderer to also allocate surfaces, the application could open IDirectDrawand then pass the interface to the loaded driver through IDirectDrawVideo::SetDirectDraw.

Alternatively, the application could let the renderer load DirectDraw and then obtain a reference-incremented interface to it through IDirectDrawVideo::GetDirectDraw.

Because DirectShow ships with the most recently shipped version of DirectDraw, this method is not required unless the application wants to change display modes itself and pass in a DirectDraw object, which the renderer can then use to allocate surfaces.

Requirements

Windows Embedded CE Windows CE 2.12 and later
Windows Mobile Pocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later
Note Microsoft DirectShow applications and DirectShow filters have different include file and Library requirements
For more information, see Setting Up the Build Environment,
Version 2.12 requires DXPAK 1.0 or later