vc MFC程序解释 哪位高手给解释解释我的程序,每一句话的解释啊 ,谢谢
{//TODO:在此添加命令处理程序代码CFileDialog*pDlg;charFilename[256]="Image.bmp";if(m_pView&&m_pVie...
{
// TODO: 在此添加命令处理程序代码
CFileDialog *pDlg;
char Filename[256]="Image.bmp";
if(m_pView && m_pView->GetImage() && m_pView->GetBitmapInfo())
{
pDlg=new CFileDialog(FALSE,"bmp",Filename,
OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,
"Bitmaps (*.bmp)|*.bmp|All files (*.*)|*.*||",
this);
m_pDlgModal=pDlg;
if(pDlg)
{
pDlg->m_ofn.lpstrFile=Filename;
pDlg->m_ofn.nMaxFile=sizeof(Filename);
if(pDlg->DoModal()==IDOK)
{
WriteBitmap(Filename);
}
delete pDlg;
}
// Special handling: CFileDialog does not close with EndDialog (s. OnEndThread)
// Instead it quits with the PostQuitMessage. So if we are here and the pointer
// is NULL we must post the quit message again.
if(m_pDlgModal==NULL)
PostQuitMessage(0);
m_pDlgModal=NULL;
}
} 展开
// TODO: 在此添加命令处理程序代码
CFileDialog *pDlg;
char Filename[256]="Image.bmp";
if(m_pView && m_pView->GetImage() && m_pView->GetBitmapInfo())
{
pDlg=new CFileDialog(FALSE,"bmp",Filename,
OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,
"Bitmaps (*.bmp)|*.bmp|All files (*.*)|*.*||",
this);
m_pDlgModal=pDlg;
if(pDlg)
{
pDlg->m_ofn.lpstrFile=Filename;
pDlg->m_ofn.nMaxFile=sizeof(Filename);
if(pDlg->DoModal()==IDOK)
{
WriteBitmap(Filename);
}
delete pDlg;
}
// Special handling: CFileDialog does not close with EndDialog (s. OnEndThread)
// Instead it quits with the PostQuitMessage. So if we are here and the pointer
// is NULL we must post the quit message again.
if(m_pDlgModal==NULL)
PostQuitMessage(0);
m_pDlgModal=NULL;
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询