// AgentPage.cpp : 实现文件 // #include "stdafx.h" #include "AgentPage.h" #include "afxdialogex.h" #include "../MsgCenter.h" // CAgentPage 对话框 IMPLEMENT_DYNAMIC(CAgentPage, CDialog) CAgentPage::CAgentPage(CWnd* pParent /*=NULL*/) : CDialog(CAgentPage::IDD, pParent) { } CAgentPage::~CAgentPage() { } void CAgentPage::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); DDX_Control(pDX, IDC_LIST_AGENT, m_AgentList); } BEGIN_MESSAGE_MAP(CAgentPage, CDialog) END_MESSAGE_MAP() // CAgentPage 消息处理程序 /***************************************************************** **【函数名称】 onMessage **【函数功能】 系统消息处理 **【参数】 **【返回值】 *****************************************************************/ void CAgentPage::onMessage( UINT MsgType, const PARAM lpContent ) { if(MsgType == ACD_MSG_AGENT_STATE_UPDAET) { m_AgentList.onAgentStateUpdated((UINT)lpContent); } else if(MsgType == ACD_MSG_AGENT_LOGOUT) { m_AgentList.onAgentStateUpdated((UINT)lpContent); } } BOOL CAgentPage::OnInitDialog() { __super::OnInitDialog(); // TODO: 在此添加额外的初始化 m_AgentList.format(); CMsgCenter::GetInstance().regist(ACD_MSG_AGENT_STATE_UPDAET, this); CMsgCenter::GetInstance().regist(ACD_MSG_AGENT_LOGOUT, this); return TRUE; // return TRUE unless you set the focus to a control // 异常: OCX 属性页应返回 FALSE }