📄 mydialog.cpp
字号:
// MyDialog.cpp : implementation file
//
#include "stdafx.h"
#include "ListText.h"
#include "MyDialog.h"
#include "ListTextDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// MyDialog dialog
MyDialog::MyDialog(CWnd* pParent /*=NULL*/)
: CDialog(MyDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(MyDialog)
m_MySms = _T("");
//}}AFX_DATA_INIT
}
void MyDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(MyDialog)
DDX_Text(pDX, IDC_SmsEdit, m_MySms);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(MyDialog, CDialog)
//{{AFX_MSG_MAP(MyDialog)
ON_EN_CHANGE(IDC_SmsEdit, OnChangeSmsEdit)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// MyDialog message handlers
void MyDialog::OnChangeSmsEdit()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
/* char sRead[128];
CFile mFile;
char* pFileName = "wokao.txt";
if(mFile.Open(pFileName, CFile::modeRead,NULL)==0)
return;
m_MySms=mFile.Read(sRead,2);
mFile.Close(); */
/* CFile file;
const char*filename="D:\\wokao.txt";
file.Open("wokao.txt",CFile::modeRead);
ULONGLONG flength;
flength=file.GetLength();
char buf[128];
//CString nBytesRead;
//nBytesRead=
file.Read(buf,sizeof(buf));
m_MySms=buf;
file.Abort();
}
*/
}
void MyDialog::OnButton1()
{
// TODO: Add your control notification handler code here
char szBuffer[300];
int i;
UINT dwActual;
for( i=0; i<100; i++ )
szBuffer[i] = NULL;
CFile myfile;
// CFileException fileException;
myfile.Open("wokao.txt",CFile::modeRead);
myfile.Seek( 0, CFile::begin );
dwActual = (UINT)myfile.SeekToEnd();
myfile.SeekToBegin();
myfile.Read(szBuffer, sizeof(szBuffer));
myfile.Close();
m_MySms=szBuffer;
UpdateData(0);
}
/*void MyDialog::SmsContent()
{
MyDialog dlg;
dlg.DoModal();
m_MySms=SetWindowText(buf[j].szJe);
}
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -