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

Scenario 12: 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.

    1. Call the Logout API to log out of the system.

  2. Implement the callback function.

    Implement the OnLogoutResult function.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
/**
* Logout
*/
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);
}