📄 myformview.cpp
字号:
// MyFormView.cpp : implementation file
//
#include "stdafx.h"
#include "短信群发.h"
#include "MyFormView.h"
#include "MyListView.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyFormView
IMPLEMENT_DYNCREATE(CMyFormView, CFormView)
CMyFormView::CMyFormView()
: CFormView(CMyFormView::IDD)
{
//{{AFX_DATA_INIT(CMyFormView)
m_strPhone = _T("");
m_count=0;
m_strMessage1 = _T("");
//}}AFX_DATA_INIT
}
CMyFormView::~CMyFormView()
{
}
void CMyFormView::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMyFormView)
DDX_CBString(pDX, IDC_PHONE, m_strPhone);
DDX_Text(pDX, IDC_MESSAGE, m_strMessage1);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMyFormView, CFormView)
//{{AFX_MSG_MAP(CMyFormView)
ON_BN_CLICKED(IDC_SEND, OnSend)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyFormView diagnostics
#ifdef _DEBUG
void CMyFormView::AssertValid() const
{
CFormView::AssertValid();
}
void CMyFormView::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMyFormView message handlers
void CMyFormView::OnSend()
{
// TODO: Add your control notification handler code here
UpdateData(true);
if(!pub.PhoneCheck(m_strPhone))
{
return;
}
if(!pub.LengthCheck2(m_strMessage1,140))
{
AfxMessageBox("内容的长度最大为140!");
return;
}
LPTSTR pPhone =(LPTSTR)(LPCTSTR)m_strPhone;
if (m_strMessage1.IsEmpty())
{
return;
}
CMyListView *pListView = (CMyListView *)(((CMainFrame *)AfxGetMainWnd())->m_secondsplitter.GetPane(0,0));
m_count=pListView->GetListCtrl().GetItemCount();
LV_ITEM lvi;
lvi.mask=LVIF_TEXT;
lvi.iSubItem=0;
lvi.iItem=m_count;
lvi.pszText=pPhone;
pListView->GetListCtrl().InsertItem(&lvi);
pListView->GetListCtrl().SetItemText(m_count,1,m_strMessage1);
m_count++;
m_strPhone.Empty();
m_strMessage1.Empty();
UpdateData(FALSE);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -