How to avoid BLINKING when creating a CDialog at background?
I use MFC Visual C++ 4.2. Recently, I am improving an existing project. On a
part of that project there is a process of when a button( "PRINT" ) is
clicked, it will run these processes:
CMyDlg* pDlg;
pDlg = new CMyDlg();
pDlg->SetDefaultData( pData1, cObData, &PrtLst, &ViewLst, &m_sName );
pDlg->Create( this );
pDlg->m_iMode = MODE_ENTRY;
pDlg->GenerateData();
pDlg->DestroyWindow();
function Create source code:
BOOL CMyDlg::Create( CWnd* pWnd )
{
m_pParent = pWnd;
CDialog::Create( CMyDlg::IDD, m_pParent);
this->ShowWindow( SW_HIDE );
return TRUE;
}
CMyDlg is a class derived from CDialog.
Shortly, processes above will create a CDialog at the background( INVISIBLE
) and then do a print job. I still don't know why it is necessary to create a
CDialog instead of just ran their member functions but my duty now is to fix
the problem of BLINKING.
Every time, the "PRINT" button is clicked, it will BLINK of about 5 times
before it output the print result.
How to make this process ran "quietly" without any BLINK and do the Print
process as usual?
Thank you very much.