Scenario 12: Exit
Description
When a third-party application exits, the SDK needs to be deinitialized. Otherwise, the HwmSdk.exe process (main process of the Windows SDK) keeps running in the background.
Service Process
To exit the SDK, call the Exit API and then implement the OnExitResult function.
- Call the API.
Call the Exit API to exit the SDK.
- Implement the callback function.
Implement the OnExitResult function.
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")); } } |
1 2 3 4 5 6 7 8 9 10 11 |
/** * Exit callback */ void demoCallbackProc::OnExitResult(hwmsdk::HwmErrCode ret, const char* msg) { CString codeStr; codeStr.Format(_T("%d"), ret); string msgStr = CTools::UTF82MultiByte(msg); CString tips = _T("OnExitResult code:") + codeStr + _T(", msg:") + CString(msgStr.c_str()); AfxMessageBox(tips); } |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot