Microsoft DirectX 8.1 (Visual Basic)

DirectXFileSave.CreateDataObject

Creates a data object.

object.CreateDataObject( _
    TemplateGuid As String, _
    Name As String, _
    DataTypeGuid As String, _
    ByteCount As Long, _
    Data As Any) As DirectXFileData

Parts

object
Object expression that resolves to a DirectXFileSave object.
TemplateGuid
String value containing the data object's template globally unique identifier (GUID).
Name
String value containing the object's name. Specify an empty string if the object does not have a name.
DataTypeGuid
String value containing the data object's GUID. Specify an empty string if the object does not have a GUID.
ByteCount
Long value containing the size of the data object, in bytes.
Data
Buffer containing all required member's data.

Return Values

DirectXFileData object, representing the created file data object.

Error Codes

If the method fails, an error is raised and Err.Number can be set to one of the following values.

DXFILEERR_BADALLOC
DXFILEERR_BADVALUE

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

Remarks

If a data reference object will reference the data object, either the Name or DataTypeGuid parameter must be a non-empty string.

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

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

See Also

DirectXFileData.AddDataObject, DirectXFileSave.SaveData, DirectXFileSave.SaveTemplates