ID3DInclude::Open Method

A user-implemented method for opening and reading the contents of a shader #include file.

Syntax

public:
HRESULT Open(
         D3D_INCLUDE_TYPE IncludeType,
         LPCSTR pFileName,
         LPCVOID pParentData,
         LPCVOID *ppData,
         UINT *pBytes
)  

Parameters

IncludeType
Type: D3D_INCLUDE_TYPE 

A D3D_INCLUDE_TYPE-typed value that indicates the location of the #include file.

pFileName
Type: LPCSTR 

Name of the #include file.

pParentData
Type: LPCVOID 

Pointer to the container that includes the #include file. The compiler might pass NULL in pParentData. For more information, see the “Searching for Include Files” section in Compile an Effect (Direct3D 11).

ppData
Type: LPCVOID *

Pointer to the buffer that contains the include directives. This pointer remains valid until you callID3DInclude::Close.

pBytes
Type: UINT *

Pointer to the number of bytes that Open returns in ppData.

Return value

Type: HRESULT 

The user-implemented method must return S_OK. If Open fails when it reads the #include file, the application programming interface (API) that caused Open to be called fails. This failure can occur in one of the following situations:

Requirements

Header: Declared in d3d11_x.h (d3dcommon.h on other Windows platforms).

Library: Use d3d11_x.lib (d3d11.lib on other Windows platforms).

See also

ID3DInclude

ID3DInclude Members