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

📄 choosedlg.cpp

📁 pop3例子程序
💻 CPP
字号:
// ChooseDlg.cpp : implementation file
//

#include "stdafx.h"
#include "pop3.h"
#include "pop3Dlg.h"
#include "ViewDlg.h"
#include "ChooseDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CChooseDlg dialog


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


void CChooseDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CChooseDlg)
	DDX_Control(pDX, IDC_MSGLIST, ctlList);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CChooseDlg, CDialog)
	//{{AFX_MSG_MAP(CChooseDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CChooseDlg message handlers

void CChooseDlg::AddToList(CString s)
{
ctlList.AddString((LPCSTR)s);
}

BOOL CChooseDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	CPop3Dlg* par;
	par=(CPop3Dlg*)GetParent(); //get parent to obtain messages infos
	for(int i=0;i<par->pop3.GetRetrMsgNum();i++)
	{
		AddToList(par->pop3.GetMsgSubject(i));
	}
	ctlList.SetCurSel(0);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CChooseDlg::OnOK() 
{
	// TODO: Add extra validation here
	CPop3Dlg* par;
	par=(CPop3Dlg*)GetParent();
	CViewDlg dlg; 
	//get msg stuff and body and show it
	dlg.text=par->pop3.GetMsgStuff(ctlList.GetCurSel());
	dlg.text+=par->pop3.GetMsgBody(ctlList.GetCurSel());
	dlg.DoModal();
	//CDialog::OnOK();
}

⌨️ 快捷键说明

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