-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathSendFileByXModem.cpp
58 lines (47 loc) · 1.39 KB
/
SendFileByXModem.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// SendFileByXModem.cpp : implementation file
//
#include "stdafx.h"
#include "MyComm.h"
#include "SendFileByXModem.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSendFileByXModem dialog
CSendFileByXModem::CSendFileByXModem(CWnd* pParent /*=NULL*/)
: CDialog(CSendFileByXModem::IDD, pParent)
{
//{{AFX_DATA_INIT(CSendFileByXModem)
m_SendFileName = _T("");
m_ModemType = -1;
//}}AFX_DATA_INIT
}
void CSendFileByXModem::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSendFileByXModem)
DDX_Text(pDX, IDC_EDFILENAME, m_SendFileName);
DDX_Radio(pDX, IDC_RD_XMODEM, m_ModemType);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSendFileByXModem, CDialog)
//{{AFX_MSG_MAP(CSendFileByXModem)
ON_BN_CLICKED(IDC_BTSELECTFILE, OnBtselectfile)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSendFileByXModem message handlers
void CSendFileByXModem::OnBtselectfile()
{
// TODO: Add your control notification handler code here
CFileDialog dlg(TRUE, NULL, "",
OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_NOCHANGEDIR,
"All FIle (*.*)|*.*|Txt (*.txt)|*.txt");
if (dlg.DoModal() == IDOK)
{
m_SendFileName = dlg.GetPathName();
UpdateData(FALSE);
}
}