|
dear all,I have a question,when I write files,like pdf,i want to popup a dialog with animation to show
that the writing operation is working.
I don't know how to do with that ,it may need a avi file ,use CAnimateCtrl,is it need multithread,please
help me.this is my code
void CMainFrame::OnExportPdf()
{
CExportPro* ExPro;
ExPro = new CExportPro();
CFileDialog dlg(FALSE,TEXT("txt"),NULL,OFN_HIDEREADONLY|OFN_FILEMUSTEXIST|OFN_PATHMUSTEXIST|OFN_OVERWRITEPROMPT,_T("TXT (*.txt) |*.txt|"));
CString fileName;
CString filePath;
if(dlg.DoModal()==IDOK )
{
ExPro->SetCaption(TEXT("pdf"));
ExPro->Create();
ExPro->ShowWindow(SW_SHOW);
filePath = dlg.GetPathName();
m_filepathname = dlg.GetPathName();
if ( !filePath.IsEmpty())
{
CFile file;
CString str(TEXT("hello this is the test for write process"));
file.Open(filePath.GetBuffer(),CFile::modeCreate|CFile::modeWrite);
while (i<1000000)
{
file.Write(str,str.GetLength());
i++;
}
file.Close();
}
}
}
BOOL CExportPro::OnInitDialog()
{
CDialogEx::OnInitDialog();
SetWindowText(m_StrCaption);
m_avi.Open(IDR_AVI1);
m_avi.Play(0,-1, -1);
return TRUE;
}
I know It is not my means,but how can do ,when writing it display avi.
|
|
|
|
|
Where exactly are you stuck?
Perform all your file writing operations in a background thread, and compute and post messages on the operation progress from the worker thread to your main window. Your main window procedure should handle this message and display the progress accordingly.
"Real men drive manual transmission" - Rajesh.
modified 4-Jan-13 6:20am.
|
|
|
|
|
Thanks,but I use CAnimateCtrl,this is a control,I initial it in dialog CExportPro::OnInitDialog(),I think
when modalless diaolog appear,the control should be appear ,but the fact is that when writing it appear modalless diaolog without CAnimateCtrl,and after writing,the CAnimateCtrl show,why,it maybe the thread
hang_up.how to do with it.
|
|
|
|