Updated on 2024-07-30 GMT+08:00

Scenario 11: Logout

Description

You can call this API to log out of Huawei Cloud Meeting.

Service Process

When using the SDK for logout, call the Logout API and then implement the OnLogoutResult function.

  1. Call the API.

    Call the Logout API to log out of Huawei Cloud Meeting.

  2. Implement the callback function.

    Implement the OnLogoutResult function.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
/**
* Log out.
*/
void demoMainMenuDlg::OnBnClickedLogout()
{
    // Call the logout API.
    int ret = hwmsdkagent::Logout();
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Logout error"));
    }
}

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
/**
* Logout API callback
*/
void demoCallbackProc::OnLogoutResult(hwmsdk::HwmErrCode ret, const char* msg)
{
    CString codeStr;
    codeStr.Format(_T("%d"), ret);
    string msgStr = CTools::UTF82MultiByte(msg);
    CString tips = _T("OnLogoutResult code:") + codeStr + _T(", msg:") + CString(msgStr.c_str());
    AfxMessageBox(tips);
}