⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 celllinemonitordlg.cpp

📁 windows mobile下tapi实现监视电话线路的程序。vs2008下创建
💻 CPP
字号:
// CellLineMonitorDlg.cpp : implementation file
//

#include "stdafx.h"
#include "CellLineMonitor.h"
#include "CellLineMonitorDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

// CCellLineMonitorDlg dialog

CCellLineMonitorDlg::CCellLineMonitorDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CCellLineMonitorDlg::IDD, pParent)
{
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CCellLineMonitorDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_EVENTS, m_wndEvents);
}

BEGIN_MESSAGE_MAP(CCellLineMonitorDlg, CDialog)
#if defined(_DEVICE_RESOLUTION_AWARE) && !defined(WIN32_PLATFORM_WFSP)
	ON_WM_SIZE()
#endif
	ON_WM_DESTROY()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


// CCellLineMonitorDlg message handlers

BOOL CCellLineMonitorDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon

	if(m_cDevice.Initialize(theApp.m_hInstance,this))
	{
		DisplayTAPIInfo();
		
		if(!m_cDevice.OpenLine())
		{
			MessageBox(TEXT("Cannot open the line for monitoring"));
		}
	}
	
	return TRUE;  // return TRUE  unless you set the focus to a control
}

#if defined(_DEVICE_RESOLUTION_AWARE) && !defined(WIN32_PLATFORM_WFSP)
void CCellLineMonitorDlg::OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/)
{
	if (AfxIsDRAEnabled())
	{
		DRA::RelayoutDialog(
			AfxGetResourceHandle(), 
			this->m_hWnd, 
			DRA::GetDisplayMode() != DRA::Portrait ? 
			MAKEINTRESOURCE(IDD_CELLLINEMONITOR_DIALOG_WIDE) : 
			MAKEINTRESOURCE(IDD_CELLLINEMONITOR_DIALOG));
	}
}
#endif

void CCellLineMonitorDlg::DisplayTAPIInfo()
{
	TCHAR	szIMEI[MAX_PATH];
	TCHAR	szManufacturer[MAX_PATH];
	TCHAR	szModal[MAX_PATH];
	TCHAR	szSubscriber[MAX_PATH];
	TCHAR	szRevision[MAX_PATH];

	m_cDevice.GetGeneralInfo(szIMEI,szManufacturer,szModal,szSubscriber,szRevision);

	CString	strInfo;

	strInfo.Format(TEXT("IMEI: %s\r\nManufacturor: %s\r\nModal: %s\r\nSubscriber: %s\r\nRevision: %s\r\n"),
				   szIMEI,szManufacturer,szModal,szSubscriber,szRevision);

	GetDlgItem(IDC_STATIC_1)->SetWindowText(strInfo);
}


void CCellLineMonitorDlg::OnDestroy()
{
	m_cDevice.Shutdown();

	CDialog::OnDestroy();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -