// demoAcceptConfDlg.cpp : 实现文件
//

#include "stdafx.h"
#include "demoAcceptConfDlg.h"
#include "afxdialogex.h"
#include "HwmSdkAgent.h"

// demoAcceptConfDlg 对话框

IMPLEMENT_DYNAMIC(demoAcceptConfDlg, CDialogEx)

demoAcceptConfDlg::demoAcceptConfDlg(CWnd* pParent /*=NULL*/)
	: CDialogEx(IDD_ACCEPT_CONF_DIALOG, pParent)
{

}

demoAcceptConfDlg::~demoAcceptConfDlg()
{
}

void demoAcceptConfDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
    DDX_Control(pDX, IDC_CHECK_IS_AUDIO_ACCEPT, m_isAudioAccept);
}

BOOL demoAcceptConfDlg::OnInitDialog()
{
    CDialog::OnInitDialog();
    return TRUE;
}


BEGIN_MESSAGE_MAP(demoAcceptConfDlg, CDialogEx)
    ON_BN_CLICKED(IDOK, &demoAcceptConfDlg::OnBnClickedOk)
END_MESSAGE_MAP()


// demoAcceptConfDlg 消息处理程序


void demoAcceptConfDlg::OnBnClickedOk()
{
    hwmsdkagent::HwmAcceptConfParam info{};
    info.isAudioAccept = (m_isAudioAccept.GetCheck() == 1) ? true : false;

    int ret = hwmsdkagent::AcceptConf(&info);;
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("accept conf error"));
        return;
    }
    CDialogEx::OnOK();
}