Help Center/ Meeting/ Client SDK Reference/ Windows SDK/ API Reference/ Basic Settings/ Obtaining the Path for Saving User Files
Updated on 2024-07-30 GMT+08:00

Obtaining the Path for Saving User Files

GetUserSavePath

API Description

This API is used to obtain the path for saving user files (including local recording files).

Precautions

  1. This API is an asynchronous API. The return value only indicates whether the API is successfully called. The actual service processing result is returned in the corresponding callback function.

Method Definition

1
HWM_SDK_AGENT_API hwmsdk::HwmErrCode GetUserSavePath(HWMSavePathType type);

Callback Function

1
virtual void OnGetUserSavePath(hwmsdk::HwmErrCode ret, const char* msg, const HwmUserSavePathInfo* pathInfo) {};

Parameter Description

Table 1 Parameter description

Parameter

Mandatory

Type

Description

type

Yes

HWMSavePathType

Enumerated path types.

Table 2 HwmUserSavePathInfo description

Parameter

Type

Description

pathType

HWMSavePathType

Enumerated path types.

path

char[]

Save path. The value is an absolute path and must be encoded in UTF-8.

Return Values

Table 3 Return value

Type

Description

HwmErrCode

If 0 is returned, the operation is successful. If other values are returned, the operation fails. For details about values returned upon failures, see Common Error Codes.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
/**
* Obtain the path for saving user files.
*/
void demoSetUserSavePathDlg::OnBnClickedGetUserSavePath()
{
    int ret = hwmsdkagent::GetUserSavePath(hwmsdkagent::HWM_SAVE_PATH_LOCAL_RECORD);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Set get path failed"));
    }
}