ID3DXFileSaveObject::AddDataObject

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

HRESULT AddDataObject(
  REFGUID rguidTemplate,
  LPCSTR szName,
  CONST GUID * pId,
  SIZE_T cbSize,
  LPCVOID pvData,
  ID3DXFileSaveData ** ppObj
);

Parameters

rguidTemplate
[in] GUID representing the data object's template.
szName
[in] Pointer to the name of the data object. Specify NULL if the object does not have a name.
pId
[in] Pointer to a GUID representing the data object. Specify NULL if the object does not have a GUID.
cbSize
[in] Size of the data object, in bytes.
pvData
[in] Pointer to a buffer containing all required data in the data object.
ppObj
[in, retval] Address of a pointer to an ID3DXFileSaveData interface, representing the file data node to which the data object will be added.

Return Values

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, DXFILEERR_BADVALUE, E_OUTOFMEMORY.

Remarks

If a data reference object will reference the data object, either the szName or pId parameter must be non-NULL.

Save the created data to disk by using the ID3DXFileSaveObject::Save method.

Requirements

Header: Declared in D3dx9xof.h.