Microsoft DirectX 9.0

IDirectXFileSaveObject::CreateDataObject Method

Creates a data object.


HRESULT CreateDataObject(      

    REFGUID rguidTemplate,     LPCSTR szName,     const GUID *pguid,     DWORD cbSize,     LPVOID pvData,     LPDIRECTXFILEDATA *ppDataObj );


[in] Globally unique identifier (GUID) representing the data object's template.
[in] Pointer to the name of the data object. Specify NULL if the object does not have a name.
[in] Pointer to a GUID representing the data object. Specify NULL if the object does not have a GUID.
[in] Size of the data object, in bytes.
[in] Pointer to a buffer containing all required member's data.
[out, retval] Address of a pointer to an IDirectXFileData interface, representing the created file data object.

Return Value

If the method succeeds, the return value is DXFILE_OK.

If the method fails, the return value can be one of the following values.

DXFILEERR_BADALLOCMemory allocation failed.
DXFILEERR_BADVALUEParameter is invalid.


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

Save any templates by using the IDirectXFileSaveObject::SaveTemplates method before saving the data created by this method. Save the created data by using the IDirectXFileSaveObject::SaveData method.

If you need to save optional data, use the IDirectXFileData::AddDataObject method after using this method and before using IDirectXFileSaveObject::SaveData. If the object has child objects, add them before calling IDirectXFileSaveObject::SaveData.

See Also

IDirectXFileData::AddDataObject, IDirectXFileSaveObject::SaveData, IDirectXFileSaveObject::SaveTemplates

© 2002 Microsoft Corporation. All rights reserved.