2.1.10.45 okutil_get_origin_path


Description

Returns the full path to System, Group or User folder, plus a subfolder if desired.

Syntax

string okutil_get_origin_path( int nPathType, LPCSTR lpcszSubPath = NULL, BOOL bCheckExistAndDiffFromUserPath = FALSE )

Parameters

nPathType
[input] one of the constants in the enum ORIGIN_PATH_TYPE
lpcszSubPath
[input] (NULL by default) this is appended to the path if not NULL. Leave off final backslash. It will be added.
bCheckExistAndDiffFromUserPath
[input]
if false, the folder is retured whether it exists or not.
if true, then the function will return empty string if
1) the folder does not exist
or
2) it exists but is equal to the User path AND nPathType!=ORIGIN_PATH_USER.
(bCheckExistsAndDiffFromUserPath has no effect if nPathType=ORIGIN_PATH_USER)
Set to true if searching ORIGIN_PATH_USER folder first, then other folders, and you don't want to bother searching if not needed.

Return

Return full path with final backslash to the desired Origin folder.

Examples

EX1

void okutil_get_origin_path_ex1()
{    
    string strUserThemePath, strUserThemeSubPath, strSystemThemePath;
    strUserThemePath = okutil_get_origin_path(ORIGIN_PATH_USER, "Theme");
    strUserThemeSubPath = okutil_get_origin_path(ORIGIN_PATH_USER, "Theme\\Subpath");
    strSystemThemePath = okutil_get_origin_path(ORIGIN_PATH_SYSTEM, "Theme");
}

Remark

See Also

Header to Include

origin.h

Reference