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

Ending Sharing

StopShare

API Description

This API is used to end sharing in a meeting. The UI of the SDK has implemented the function of stopping sharing. You can call this API to stop sharing on a third-party application.

Precautions

  1. Do not call this API if no participant is sharing content.
  2. 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 StopShare();

Callback Function

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

Parameter Description

None

Return Values

Table 1 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
/**
* End sharing.
*/
void demoConfCtrlDlg::OnBnClickedButtonStopShare()
{
    // End sharing.
    int ret = hwmsdkagent::StopShare();
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("StopShare error"));
    }
}