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

Exiting the SDK

Exit

API Description

This API is used to exit the SDK.

Precautions

  1. After this API is called, the SDK cannot be used.
  2. Call this API before exiting the application. If this API is not called, the SDK cannot exit and the SDK process still runs in the background after the application exits.
  3. 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 Exit();

Callback Function

1
virtual void OnExitResult(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
/**
* Exit the SDK.
*/
void CdemoBeforeLoginDlg::OnBnClickedButtonExit()
{
    int ret = hwmsdkagent::Exit();
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Exit error"));
    }
}