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

📄 ivrserverview.cpp

📁 一个声讯平台的管理平台.包括平台的客户端何服务器端口.是个不错的软件.
💻 CPP
字号:
// IvrServerView.cpp : implementation of the CIvrServerView class
//

#include "stdafx.h"
#include "IvrServer.h"

#include "IvrServerDoc.h"
#include "IvrServerView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CIvrServerView

IMPLEMENT_DYNCREATE(CIvrServerView, CEditView)

BEGIN_MESSAGE_MAP(CIvrServerView, CEditView)
	//{{AFX_MSG_MAP(CIvrServerView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CEditView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CEditView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CEditView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CIvrServerView construction/destruction

CIvrServerView::CIvrServerView()
{
	// TODO: add construction code here

}

CIvrServerView::~CIvrServerView()
{
}

BOOL CIvrServerView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	BOOL bPreCreated = CEditView::PreCreateWindow(cs);
	cs.style &= ~(ES_AUTOHSCROLL|WS_HSCROLL);	// Enable word-wrapping

	return bPreCreated;
}

/////////////////////////////////////////////////////////////////////////////
// CIvrServerView drawing

void CIvrServerView::OnDraw(CDC* pDC)
{
	CIvrServerDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CIvrServerView printing

BOOL CIvrServerView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default CEditView preparation
	return CEditView::OnPreparePrinting(pInfo);
}

void CIvrServerView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
{
	// Default CEditView begin printing.
	CEditView::OnBeginPrinting(pDC, pInfo);
}

void CIvrServerView::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo)
{
	// Default CEditView end printing
	CEditView::OnEndPrinting(pDC, pInfo);
}

/////////////////////////////////////////////////////////////////////////////
// CIvrServerView diagnostics

#ifdef _DEBUG
void CIvrServerView::AssertValid() const
{
	CEditView::AssertValid();
}

void CIvrServerView::Dump(CDumpContext& dc) const
{
	CEditView::Dump(dc);
}

CIvrServerDoc* CIvrServerView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CIvrServerDoc)));
	return (CIvrServerDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CIvrServerView message handlers

void CIvrServerView::ShowMsg(char *lpszMessage, UINT bNeedShow)
{
		if(bNeedShow==1)
	{
		CString strTemp;
		CString currtime;

		m_OpenMutex.Lock(2);
		/************************************生成当前的文件名************************************/
		COleDateTime dateTest;
		dateTest = COleDateTime::GetCurrentTime();
		
 		currtime.Format("%02d月%02d日%02d时%02d分%02d秒  ", \
					dateTest.GetMonth(), \
					dateTest.GetDay(), dateTest.GetHour(), \
					dateTest.GetMinute(),dateTest.GetSecond());
		strTemp = currtime;
		strTemp += lpszMessage;
		strTemp += _T("\r\n");

		int len = GetWindowTextLength();
		if(GetEditCtrl().GetLineCount()>5000)
		{
		    GetEditCtrl().SetSel(0,len);
			GetEditCtrl().ReplaceSel("");
		} 
		GetEditCtrl().SetSel(len,len);
		GetEditCtrl().ReplaceSel(strTemp);
		GetDocument()->SetModifiedFlag(FALSE);		
		m_OpenMutex.Unlock();
	}
	return;
}

void CIvrServerView::OnInitialUpdate() 
{
	CEditView::OnInitialUpdate();
	
	// TODO: Add your specialized code here and/or call the base class
	this->GetEditCtrl().SetReadOnly(true);
}

void CIvrServerView::OnMenuClear()
{
	int intMess=MessageBox("您将删除视图上所有的提示信息,确定删除吗?","警告信息",MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON1);
	if(intMess == IDYES)
	{
		SetTimer(1,300,NULL);

		int len = GetWindowTextLength();
		GetEditCtrl().SetSel(0,len);
		GetEditCtrl().ReplaceSel("");
	}
}

⌨️ 快捷键说明

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