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

📄 datashowdoc.cpp

📁 CAN__组建现场总线系统设计技术(光盘)
💻 CPP
字号:
// DataShowDoc.cpp : implementation file
//

#include "stdafx.h"
#include "VCStyle.h"
#include "DataShowDoc.h"

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

#include "data.h"
#include "DataShowView.h"
/////////////////////////////////////////////////////////////////////////////
// CDataShowDoc

IMPLEMENT_DYNCREATE(CDataShowDoc, CDocument)

CDataShowDoc::CDataShowDoc()
{
	m_addr = 255;
	m_ch = 255;
}

BOOL CDataShowDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;
	return TRUE;
}

CDataShowDoc::~CDataShowDoc()
{
}


BEGIN_MESSAGE_MAP(CDataShowDoc, CDocument)
	//{{AFX_MSG_MAP(CDataShowDoc)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDataShowDoc diagnostics

#ifdef _DEBUG
void CDataShowDoc::AssertValid() const
{
	CDocument::AssertValid();
}

void CDataShowDoc::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CDataShowDoc serialization

void CDataShowDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
}

/////////////////////////////////////////////////////////////////////////////
// CDataShowDoc commands

BOOL CDataShowDoc::OnOpenDocument(LPCTSTR lpszPathName) 
{
	UINT addr,ch;
	//lpszPathName格式:"模块地址,通道号"
	sscanf(lpszPathName,"%d,%d",&addr,&ch);

	m_addr = addr;
	m_ch = ch;

	if(m_addr>=MAX_MODELS ||
		m_ch >= MAX_CHANS){
		AfxMessageBox("数据通道错!");
		return FALSE;
	}
	
//	if (!CDocument::OnOpenDocument(NULL))
//		return FALSE;
	if (!CDocument::OnNewDocument())
		return FALSE;
	return TRUE;
}

⌨️ 快捷键说明

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