Chinaunix首页 | 论坛 | 博客
  • 博客访问: 628343
  • 博文数量: 603
  • 博客积分: 4000
  • 博客等级: 上校
  • 技术积分: 4940
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-17 11:04
文章分类

全部博文(603)

文章存档

2011年(1)

2008年(602)

我的朋友

分类:

2008-09-17 11:10:56

[求助] vc++中如何实现首页,上一页,下一页,末页

void CVWFILEDlg::OnCloseupDatetimepicker1(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
CDateTimeCtrl* pFileTime = (CDateTimeCtrl*)GetDlgItem(IDC_DATETIMEPICKER1);
CTime itemTime;
pFileTime->GetTime(itemTime);
CString FileName = itemTime.Format("%Y-%m-%d");
FileName+= ".txt";
char* pFileName = FileName.GetBuffer(FileName.GetLength() + 1);

CStatic* pStatic;
pStatic = (CStatic*)GetDlgItem(IDC_STATIC);

CFile f;
CFileException e;
if( !f.Open( pFileName, CFile::modeRead, &e ) )
{
#ifdef _DEBUG
afxDump << "File could not be opened " << e.m_cause << "\n";
#endif
}

int flength = f.GetLength();
char* filecontent = new char[flength];

f.SeekToBegin();
f.Read(filecontent,flength);
pStatic->SetWindowText(filecontent);
f.Close();

*pResult = 0;
}


--------------------next---------------------

阅读(249) | 评论(0) | 转发(0) |
0

上一篇:下一主题

下一篇:显示可打印版本

给主人留下些什么吧!~~