recorddlg.cpp
来自「本系统所完成功能如下:  即时消息:用户之间发送即时消息。 」· C++ 代码 · 共 73 行
CPP
73 行
// RecordDlg.cpp : implementation file
//
#include "stdafx.h"
#include "IM.h"
#include "RecordDlg.h"
extern CString CRdir;
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// RecordDlg dialog
RecordDlg::RecordDlg(CWnd* pParent /*=NULL*/)
: CDialog(RecordDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(RecordDlg)
m_History = _T("");
//}}AFX_DATA_INIT
}
void RecordDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(RecordDlg)
DDX_Text(pDX, IDC_EDIT1, m_History);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(RecordDlg, CDialog)
//{{AFX_MSG_MAP(RecordDlg)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// RecordDlg message handlers
BOOL RecordDlg::OnInitDialog()
{
CDialog::OnInitDialog();
//聊天纪录显示初始化函数
//从本地保存的聊天纪录文件中读取数据并显示
m_History="";
CString str,temp;
int hnum;
char buffer[1000];
str.Format("%s\\%d.ini",CRdir,m_nuid);
hnum=GetPrivateProfileInt("History","Hnum",0,str);
for(int i=1;i<=hnum;i++)
{
temp.Format("h%d",hnum-i);
GetPrivateProfileString("History",temp,NULL,buffer,1000,str);
m_History=m_History+buffer+"\r\n";
temp.Format("h%d",hnum-i+1);
GetPrivateProfileString("History",temp,NULL,buffer,1000,str);
m_History=m_History+buffer+"\r\n";
i++;
}
SetDlgItemText(IDC_EDIT1,m_History);
return TRUE;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?