ID3DXFileSaveData::AddDataObject method

Adds a data object as a child of the ID3DXFileSaveData file data node.

Syntax

HRESULT AddDataObject(
  [in]               REFGUID           rguidTemplate,
  [in]               LPCSTR            szName,
  [in]         const GUID              *pId,
  [in]               SIZE_T            cbSize,
  [in]               LPCVOID           pvData,
  [in, retval]       ID3DXFileSaveData **ppObj
);

Parameters

rguidTemplate [in]

Type: REFGUID

GUID representing the data object's template.

szName [in]

Type: LPCSTR

Pointer to the name of the data object to add. Specify NULL if the object does not have a name.

pId [in]

Type: const GUID*

Pointer to a GUID representing the data object. The data object must have been registered with ID3DXFile::RegisterTemplates or ID3DXFile::RegisterEnumTemplates. Specify NULL if the object does not have a GUID.

cbSize [in]

Type: SIZE_T

Size of the data object, in bytes.

pvData [in]

Type: LPCVOID

Pointer to a buffer containing all required data in the data object.

ppObj [in, retval]

Type: ID3DXFileSaveData**

Address of a pointer to an ID3DXFileSaveData interface, representing the file data node to which the data object will be added.

Return value

Type: HRESULT

If the method succeeds, the return value is S_OK. If the method fails, the return value can be one of the following: D3DXFERR_BADOBJECT, D3DXFERR_BADVALUE, E_OUTOFMEMORY.

Requirements

Requirement Value
Header
D3DX9Xof.h
Library
D3dx9.lib

See also

ID3DXFileSaveData