MrmGetFilePathFromName function (mrm.h)

Gets the default path for a filename.

Syntax

HRESULT MrmGetFilePathFromName(
  PCWSTR filename,
  PWSTR  *filePath
);

Parameters

filename

The filename.

filePath

Will contain the file path if the call was successful.

Return value

HRESULT that indicates the result of the operation.

Remarks

This method first looks in the current module path for a file with the specified name (or resources.pri if no name was provided). If this file exists, the filePath parameter will be set to the full path of that file.

If no file was found in the previous step, this method looks in the parent directory of the current module path for a file with the specified name (or [current module name].pri if no name was provided). If this file exists, the filePath parameter will be set to the full path of that file.

If neither file exists, the filePath parameter will be set to [current module path]\[fileName], where fileName defaults to resources.pri if no filename was specified. Note that this file may not exist.

Warning

MrmGetFilePathFromName will always return a path on success. The path may not always exist.

Requirements

Requirement Value
Minimum supported client Windows 10, version 1809 (with Windows App SDK 0.5 or later)
Header mrm.h