Updated on 2023-03-23 GMT+08:00

Setting the Participant Name

RenameSelf

API Description

This API is used to set the participant name.

Precautions

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 RenameSelf(const char name[HWM_MAX_DISPLAY_NAME_LEN]);

Callback Function

1
virtual void OnRenameSelfResult(hwmsdk::HwmErrCode ret, const char* reason) {};

Parameter Description

Table 1 Parameter description

Parameter

Mandatory

Type

Description

name

Yes

char[]

Participant name.

Return Values

Table 2 Return values

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
12
13
void demoRenameSelfDlg::OnBnClickedOk()
{
    char name[HWM_MAX_DISPLAY_NAME_LEN] = {0};
    string tempString = CTools::UNICODE2UTF(CString("Hangzhou site"));
    // Set the participant name.
    strncpy_s(name, (char *)tempString.c_str(), HWM_MAX_DISPLAY_NAME_LEN);
    int ret = hwmsdkagent::RenameSelf(name);
    if(ret != hwmsdk::HWM_COMMON_SUCCESS)
    {
        AfxMessageBox(_T("Renamel self error"));
        return;
    }
}