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

📄 dilalogtransfer.cpp

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

#include "stdafx.h"
#include "app_1.h"
#include "DilalogTransfer.h"
#include "function.h"


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



/////////////////////////////////////////////////////////////////////////////
// CDilalogTransfer dialog


CDilalogTransfer::CDilalogTransfer(CWnd* pParent /*=NULL*/)
	: CDialog(CDilalogTransfer::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDilalogTransfer)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CDilalogTransfer::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDilalogTransfer)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDilalogTransfer, CDialog)
	//{{AFX_MSG_MAP(CDilalogTransfer)
	ON_BN_CLICKED(IDC_BUTTON_Special, OnBUTTONSpecial)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDilalogTransfer message handlers

void CDilalogTransfer::OnBUTTONSpecial() 
{
	// TODO: Add your control notification handler code here
    CFileDialog Filedlg(TRUE,   
    NULL,   
    NULL,   
    OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,   
    "All   files(*.*)|*.*||",   
    NULL);     
   // Filedlg.m_ofn.lpstrFile   =   lpstrFilename;     
  //  Filedlg.m_ofn.lStructSize   =   88;     
    if(Filedlg.DoModal()   ==   IDOK)   
	{   
          strFilePath   =   Filedlg.GetPathName();   
		  strFileName   =   Filedlg.GetFileName();
	}
    SetDlgItemText(IDC_EDIT_Special,strFilePath); 
	UpdateData(TRUE);
	
}

void CDilalogTransfer::OnOK() 
{
	// TODO: Add extra validation here
	 if(bFileTransfer(strFilePath,strFileName)==TRUE)
		 AfxMessageBox("文件传输成功");
	 else
		 AfxMessageBox("文件传输失败");	
     SendMessage(WM_CLOSE);
}

⌨️ 快捷键说明

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