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

#include "stdafx.h"
#include "demoSetShareStrategyDlg.h"
#include "afxdialogex.h"
#include "demo.h"
#include "HwmSdkAgent.h"


// demoSetShareStrategyDlg 对话框

IMPLEMENT_DYNAMIC(demoSetShareStrategyDlg, CDialogEx)

demoSetShareStrategyDlg::demoSetShareStrategyDlg(CWnd* pParent /*=NULL*/)
	: CDialogEx(IDD_SET_SHARE_STRATEGY, pParent)
    , m_Type(0)
{

}

demoSetShareStrategyDlg::~demoSetShareStrategyDlg()
{
}

void demoSetShareStrategyDlg::DoDataExchange(CDataExchange* pDX)
{
    CDialogEx::DoDataExchange(pDX);
    DDX_Radio(pDX, IDC_RADIO_DEFINITION_FIRST, m_Type);
}


BEGIN_MESSAGE_MAP(demoSetShareStrategyDlg, CDialogEx)
    ON_BN_CLICKED(IDC_BUTTON_SET_SHARE_STRATEGY2, &demoSetShareStrategyDlg::OnBnClickedButtonSetShareStrategy)
END_MESSAGE_MAP()


// demoSetShareStrategyDlg 消息处理程序


void demoSetShareStrategyDlg::OnBnClickedButtonSetShareStrategy()
{
    UpdateData();
    hwmsdkagent::HwmShareStrategyType type = (hwmsdkagent::HwmShareStrategyType)m_Type;
    int ret = hwmsdkagent::SetShareStrategy(type);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Set Share Strategy Result failed"));
    }
}


BOOL demoSetShareStrategyDlg::OnInitDialog()
{
    CDialogEx::OnInitDialog();

    // TODO:  在此添加额外的初始化
    m_Type = 0;
    UpdateData(FALSE);

    return TRUE;  // return TRUE unless you set the focus to a control
                  // 异常: OCX 属性页应返回 FALSE
}
