Microsoft DirectX 8.1 (Visual Basic)

DirectXFile.CreateSaveObject

Creates a save object.

object.CreateSaveObject( _
    FileName As String, _
    Flags As Long) As DirectXFileSave

Parts

object
Object expression that resolves to a DirectXFile object.
FileName
String value, identifying the file to use for saving data.
Flags
A member of the CONST_DXFILEFORMATFLAGS enumeration indicating the format to use when saving the DirectX file.

Return Values

Returns a DirectXFileSave object, representing the created save 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_BADFILE
DXFILEERR_BADVALUE

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

Remarks

After using this method, use methods of the DirectXFileSave class to create data objects and to save templates or data.

The default value for the file format is DXFILEFORMAT_BINARY. The file format values can be combined in a logical OR to create compressed text or compressed binary files. If a file is specified as both binary (0) and text (1), it will be saved as a text file because the value will be indistinguishable from the text file format value (0 + 1 = 1). If you indicate that the file format should be text and compressed, the file will first be written out as text and then compressed. However, compressed text files are not as efficient as binary text files, so in most cases you will want to indicate binary and compressed. Setting a file to be compressed without specifying a format will result in a binary, compressed file.

See Also

DirectXFileSave