资源 IDC_OPEN_BUTTON
IDC_EDIT --------m_str;
void CMy0118Dlg::OnBnClickedOpenButton()
{
CFileDialog fd(true,NULL,NULL,OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_ALLOWMULTISELECT,"all Files (*.*)|*.*||",this);
CString str(" ",10000);
if(fd.DoModal()!=IDOK)return;
CString fname=fd.GetPathName();
m_str=fname;
UpdateData(false);}
参考文件
1.
void CSampleView::Onreadbmp() //打开图片文件
{
// TODO: Add your command handler code here
char filt[220];
strcpy(filt,"BMP Files(*.bmp)|*.bmp;|");
CFileDialog fd(true,"bmp", NULL, OFN_FILEMUSTEXIST,filt,this);
if(fd.DoModal()!=IDOK)return;
CString fname=fd.GetPathName();
fname.MakeUpper();
int i,dx,dy;
i=GetBmpSize(fname,&dx,&dy);
if(i==0) return;
UINT *buf=new UINT[dx*dy];
ReadBmp(fname,dx,dy,buf);
mdr->write_video(0,0,dx,dy,buf);
mdr->swap();
delete buf;
}
2.http://download.csdn.net/detail/tianhen791/4027645