Dlg_CreateFile.cpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // Dlg_CreateFile.cpp : 实现文件
  2. //
  3. #include "stdafx.h"
  4. #include "SupportSmsPlatform.h"
  5. #include "Dlg_CreateFile.h"
  6. #include ".\dlg_createfile.h"
  7. // CDlg_CreateFile 对话框
  8. IMPLEMENT_DYNAMIC(CDlg_CreateFile, CDialog)
  9. CDlg_CreateFile::CDlg_CreateFile(CWnd* pParent /*=NULL*/)
  10. : CDialog(CDlg_CreateFile::IDD, pParent)
  11. , m_sEdit_FilePath(_T(""))
  12. , m_sEdit_Format(_T(""))
  13. {
  14. }
  15. CDlg_CreateFile::~CDlg_CreateFile()
  16. {
  17. }
  18. void CDlg_CreateFile::DoDataExchange(CDataExchange* pDX)
  19. {
  20. CDialog::DoDataExchange(pDX);
  21. DDX_Text(pDX, IDC_EDIT_FILEPATH, m_sEdit_FilePath);
  22. DDX_Text(pDX, IDC_EDIT_CONTENT, m_sEdit_Format);
  23. }
  24. BEGIN_MESSAGE_MAP(CDlg_CreateFile, CDialog)
  25. ON_BN_CLICKED(IDC_BTN_BROWSE, OnBnClickedBtnBrowse)
  26. END_MESSAGE_MAP()
  27. // CDlg_CreateFile 消息处理程序
  28. BOOL CDlg_CreateFile::OnInitDialog()
  29. {
  30. CDialog::OnInitDialog();
  31. // TODO: 在此添加额外的初始化
  32. GetIni();
  33. return TRUE; // return TRUE unless you set the focus to a control
  34. // 异常: OCX 属性页应返回 FALSE
  35. }
  36. void CDlg_CreateFile::GetIni()
  37. {
  38. UpdateData( false );
  39. }
  40. void CDlg_CreateFile::SetIni()
  41. {
  42. UpdateData( );
  43. }
  44. bool CDlg_CreateFile::Apply()
  45. {
  46. SetIni();
  47. return true;
  48. }
  49. void CDlg_CreateFile::OnBnClickedBtnBrowse()
  50. {
  51. CFileDialog dlg(TRUE,NULL,
  52. NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT |OFN_ALLOWMULTISELECT|OFN_ENABLESIZING ,
  53. _T("ALL Files (*.*)|*.*||"),NULL);
  54. if (dlg.DoModal() != IDOK)
  55. {
  56. return;
  57. }
  58. m_sEdit_FilePath = dlg.GetPathName();
  59. UpdateData( false );
  60. }