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

📄 app_1view.cpp

📁 这是USB传输数据的下位机程序!与另外一个配套使用!一个收一个发!因功能不同
💻 CPP
字号:
// app_1View.cpp : implementation of the CApp_1View class
//

#include "stdafx.h"
#include "app_1.h"

#include "app_1Doc.h"
#include "app_1View.h"

#include "DilalogTransfer.h"
#include "DialogLock.h"
#include "DialogCancell.h"
#include "function.h"

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


extern HANDLE hDevice;

/////////////////////////////////////////////////////////////////////////////
// CApp_1View

IMPLEMENT_DYNCREATE(CApp_1View, CView)

BEGIN_MESSAGE_MAP(CApp_1View, CView)
	//{{AFX_MSG_MAP(CApp_1View)
	ON_COMMAND(ID_Special_Transfer, OnSpecialTransfer)
	ON_COMMAND(ID_Lock_Transfer, OnLockTransfer)
	ON_COMMAND(ID_Lock_Cancell, OnLockCancell)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CApp_1View construction/destruction

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

}

CApp_1View::~CApp_1View()
{
}

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

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CApp_1View drawing

void CApp_1View::OnDraw(CDC* pDC)
{
	CApp_1Doc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
     if(bOpenDriver(&hDevice,"EZUSB-0")==TRUE)  
		 pDC->TextOut(10,10,"设备连接成功");
	 else
         pDC->TextOut(10,10,"设备连接失败");
	 CloseHandle(hDevice);
}

/////////////////////////////////////////////////////////////////////////////
// CApp_1View diagnostics

#ifdef _DEBUG
void CApp_1View::AssertValid() const
{
	CView::AssertValid();
}

void CApp_1View::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

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

/////////////////////////////////////////////////////////////////////////////
// CApp_1View message handlers

void CApp_1View::OnSpecialTransfer() 
{
	// TODO: Add your command handler code here
	 CDilalogTransfer SpecialTransfer;
	 if(SpecialTransfer.DoModal()==IDOK)
	 {
	 }
}



void CApp_1View::OnLockTransfer() 
{
	// TODO: Add your command handler code here
	CDialogLock LockTransfer;
	if(LockTransfer.DoModal()==IDOK)
	{
	}
}

void CApp_1View::OnLockCancell() 
{
	// TODO: Add your command handler code here
	CDialogCancell LockCancell;
    if(LockCancell.DoModal()==IDOK)
	{
	}
}


⌨️ 快捷键说明

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