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

📄 mapi smsdlg.cpp

📁 网上的通过CEMPAI来发送SMS邮件的实例
💻 CPP
字号:
#include "stdafx.h"
#include "resource.h"
#include "MAPI SMSDlg.h"

// Okay so we cheat a bit here so I could avoid creating one header file.
extern BOOL DoSendMessage(LPCTSTR lpszFrom, LPCTSTR lpszTo, LPCTSTR lpszMessage);

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

/////////////////////////////////////////////////////////////////////////////
// CMAPISMSDlg dialog

CMAPISMSDlg::CMAPISMSDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CMAPISMSDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CMAPISMSDlg)
	m_strFrom = _T("");
	m_strMessage = _T("");
	m_strTo = _T("");
	//}}AFX_DATA_INIT
	// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CMAPISMSDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CMAPISMSDlg)
	DDX_Text(pDX, IDC_FROM, m_strFrom);
	DDX_Text(pDX, IDC_MESSAGE, m_strMessage);
	DDX_Text(pDX, IDC_TO, m_strTo);
	//}}AFX_DATA_MAP

	if (pDX->m_bSaveAndValidate)
	{
		// if we are saving the changes we need to validate our data
		if (m_strFrom.IsEmpty())
		{
			AfxMessageBox(IDS_FROM_BLANK);
			AfxThrowUserException();
		}

		if (m_strTo.IsEmpty())
		{
			AfxMessageBox(IDS_TO_BLANK);
			AfxThrowUserException();
		}

		if (m_strMessage.IsEmpty())
		{
			AfxMessageBox(IDS_MESSAGE_BLANK);
			AfxThrowUserException();
		}

		if (m_strMessage.GetLength() > 159)
		{
			AfxMessageBox(IDS_MESSAGE_TOOLONG);
			AfxThrowUserException();
		}
	}
}

BEGIN_MESSAGE_MAP(CMAPISMSDlg, CDialog)
	//{{AFX_MSG_MAP(CMAPISMSDlg)
	ON_BN_CLICKED(IDC_SENDMESSAGE, OnSendmessage)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMAPISMSDlg message handlers

BOOL CMAPISMSDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
	
	CenterWindow(GetDesktopWindow());	// center to the hpc screen

	// TODO: Add extra initialization here
	
	return TRUE;  // return TRUE  unless you set the focus to a control
}



void CMAPISMSDlg::OnSendmessage() 
{
	if (UpdateData(TRUE))
	{
		DoSendMessage(m_strFrom, m_strTo, m_strMessage);
	}
	else
		; // Error should have already been reported in DoDataExchange
}

⌨️ 快捷键说明

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