AttachDlg.cpp
资源名称:mysmtp2.rar [点击查看]
上传用户:young001
上传日期:2007-07-04
资源大小:33k
文件大小:2k
源码类别:
WEB邮件程序
开发平台:
Visual C++
- // AttachDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "smtp.h"
- #include "AttachDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // AttachDlg dialog
- AttachDlg::AttachDlg(CWnd* pParent /*=NULL*/)
- : CDialog(AttachDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(AttachDlg)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- }
- void AttachDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(AttachDlg)
- DDX_Control(pDX, IDC_LIST_FILE, m_List);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(AttachDlg, CDialog)
- //{{AFX_MSG_MAP(AttachDlg)
- ON_BN_CLICKED(IDC_BUTTON_ADD, OnButtonAdd)
- ON_BN_CLICKED(IDC_BUTTON_REMOVE, OnButtonRemove)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // AttachDlg message handlers
- void AttachDlg::OnButtonAdd()
- {
- // TODO: Add your control notification handler code here
- CFileDialog dlg(TRUE);
- if (dlg.DoModal() == IDOK) {
- ((CListBox*) GetDlgItem(IDC_LIST_FILE)) -> AddString(dlg.GetPathName());
- }
- }
- void AttachDlg::OnButtonRemove()
- {
- // TODO: Add your control notification handler code here
- int nSel = ((CListBox*) GetDlgItem(IDC_LIST_FILE)) -> GetCurSel();
- if (nSel != LB_ERR) {
- ((CListBox*) GetDlgItem(IDC_LIST_FILE)) -> DeleteString(nSel);
- }
- }
- void AttachDlg::OnOK()
- {
- // TODO: Add extra validation here
- CString str;
- m_Files.RemoveAll();
- for(int lp = 0; lp < m_List.GetCount(); lp++) {
- m_List.GetText(lp, str);
- m_Files.Add(str);
- }
- CDialog::OnOK();
- }