IDirectXFile::CreateSaveObject method

Creates a save object. Deprecated.

Syntax

HRESULT CreateSaveObject(
  [in]          LPCSTR                  szFileName,
  [in]          DXFILEFORMAT            dwFileFormat,
  [out, retval] LPDIRECTXFILESAVEOBJECT *ppSaveObj
);

Parameters

szFileName [in]

Type: LPCSTR

Pointer to the name of the file to use for saving data.

dwFileFormat [in]

Type: DXFILEFORMAT

Indicates the format to use when saving the DirectX file. This value can be one of the DXFILEFORMAT_xxx flags in DXFILE Constants. For more information, see Remarks.

ppSaveObj [out, retval]

Type: LPDIRECTXFILESAVEOBJECT*

Address of a pointer to an IDirectXFileSaveObject interface, representing the created save object.

Return value

Type: HRESULT

If the method succeeds, the return value is DXFILE_OK. If the method fails, the return value can be one of the following: DXFILEERR_BADALLOC, DXFILEERR_BADFILE, DXFILEERR_BADVALUE.

Remarks

After using this method, use methods of the IDirectXFileSaveObject interface 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.

Requirements

Requirement Value
Header
DXFile.h
Library
D3dxof.lib

See also

IDirectXFile

IDirectXFileSaveObject