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

📄 remoteparamreport.cpp

📁 SDK DVR/DVS HIKVISION
💻 CPP
字号:
// RemoteParamReport.cpp : implementation file
//

#include "stdafx.h"
#include "newclient.h"
#include "RemoteParamReport.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CRemoteParamReport dialog

CRemoteParamReport::CRemoteParamReport(CWnd* pParent /*=NULL*/)
	: CDialog(CRemoteParamReport::IDD, pParent)
{
	//{{AFX_DATA_INIT(CRemoteParamReport)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	m_SuicideTimer = WM_USER + 100;
}


void CRemoteParamReport::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CRemoteParamReport)
	DDX_Control(pDX, IDC_REPORTLIST, m_ReportList);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CRemoteParamReport, CDialog)
	//{{AFX_MSG_MAP(CRemoteParamReport)
	ON_WM_TIMER()
	ON_WM_CREATE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CRemoteParamReport message handlers

void CRemoteParamReport::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
	if (nIDEvent == m_SuicideTimer)
	{
		OnCancel();
	}

	CDialog::OnTimer(nIDEvent);
}

BOOL CRemoteParamReport::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	CRect rc(0, 0, 0, 0);
	GetWindowRect(&rc);

	CRect adjust(0, 0, 0, 0);
	GetParent()->GetWindowRect(&adjust);
	ClientToScreen(&adjust);

	SetWindowPos(&CWnd::wndTop, adjust.left*3/4, adjust.top*2/3, rc.Width(), rc.Height(), SWP_SHOWWINDOW);

	// TODO: Add extra initialization here
	m_ReportList.SetExtendedStyle(LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT);
	m_ReportList.InsertColumn(0, "Error Info", LVCFMT_LEFT, 500, -1);
	
	SetTimer(m_SuicideTimer, 10000, NULL);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CRemoteParamReport::InsertReport(char *Report, int len)
{
	if (IsWindow(this->GetSafeHwnd()))
	{
		memset(m_ReportBuf, 0, MAX_PATH);
		memcpy(m_ReportBuf, Report, len);
		m_ReportList.InsertItem(m_ReportList.GetItemCount(), m_ReportBuf);
	}
}

void CRemoteParamReport::OnCancel() 
{
	// TODO: Add extra cleanup here
	KillTimer(m_SuicideTimer);
	
	CDialog::OnCancel();

	DestroyWindow();
}

int CRemoteParamReport::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CDialog::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	// TODO: Add your specialized creation code here
	
	return 0;
}

⌨️ 快捷键说明

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