Share via


IGameStatisticsMgr::GetGameStatistics Method

Retrieves the IGameStatistics interface for the game title, optionally creating it if it is not already present.

Syntax

virtual HRESULT GetGameStatistics(
         LPCWSTR GDFBinaryPath,
         GAMESTATS_OPEN_TYPE openType,
         GAMESTATS_OPEN_RESULT *pOpenResult,
         IGameStatistics **ppiStats
)

Parameters

  • GDFBinaryPath
    [in] A string that contains the fully qualified path of the binary that contains the game definition file (GDF). The GDF must be present in the default resource location.
  • openType
    [in] Member of the GAMESTATS_OPEN_TYPE enumeration, which describes how the game statistics file should be opened.
  • pOpenResult
    [out, optional, retval] Member of the GAMESTATS_OPEN_RESULT enumeration, which indicates whether an existing set of statistics was opened or a new set of statistics was created. If the function succeeds, this parameter will contain the GAMESTATS_OPEN_RESULT indicating whether an existing set of statistics was opened, or a new set of statistics was created.
  • ppiStats
    [out] If the function succeeds, ppiStats will contain the title's IGameStatistics interface.

Return Value

Returns S_OK if a games statistics object was opened or created successfully. Returns E_FILE_NOT_FOUND if the GS_OPENORCREATE flag was not specified and the file was not already present.

Remarks

If pOpenResult is returned as GAMESTATS_OPEN_CREATED, the caller should take steps to call IGameStatistics::SetStatistic and IGameStatistics::SetCategoryTitle as needed to set default values for your statistics.

Requirements

Header: Declared in gameux.h.

See Also

IGameStatisticsMgr