www

来源:互联网 发布:iphone视频后期软件 编辑:程序博客网 时间:2024/05/17 01:52
void CwayDoc::OnFileOpen()
{
// TODO: 在此添加命令处理程序代码
CFileDialog   my(true); 
if( my.DoModal() == IDOK )     

CString   FileName  = my.GetPathName(); 
CString   FileExt   = my.GetFileExt(); 


if((FileExt   ==   "AVI ")   ||   (FileExt   ==   "avi "))   

CMyApp   *   pMyApp   =   (CMyApp   *)AfxGetApp(); 
CMultiDocTemplate*pAVIDocTemplate=pMyApp-> m_pAVIDocTemplate; 
pAVIDocTemplate-> OpenDocumentFile(FileName); 

else   if((FileExt   ==   "BMP ")   ||   (FileExt   ==   "bmp "))   

CMyApp   *   pMyApp   =   (CMyApp   *)AfxGetApp(); 
CMultiDocTemplate*   pDATDocTemplate=pMyApp-> m_pBMPDocTemplate; 
pDATDocTemplate-> OpenDocumentFile(FileName); 

else   { 
AfxMessageBox( "Yor   select   a   file   not   supported! "); 
return; 




}