|
// ProgressWndThread.cpp : implementation file
//
#include "stdafx.h"
#include "RemoteAdmin.h"
#include "ProgressWndThread.h"
#include "ProgressDlg.h"
#include "RemoteAdminDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
IMPLEMENT_DYNCREATE(CProgressWndThread, CWinThread)
CProgressWndThread::CProgressWndThread()
{
}
CProgressWndThread::~CProgressWndThread()
{
m_pRemoteAdminDoc->SetVisualProgressThread(NULL);
}
BOOL CProgressWndThread::InitInstance()
{
CProgressDlg* pDlg = new CProgressDlg;
pDlg->Create();
pDlg->ShowWindow(SW_NORMAL);
pDlg->CenterWindow();
pDlg->SetDocument(m_pRemoteAdminDoc);
pDlg->SetTimer(TIMER_STEP, 100, NULL);
pDlg->SetProgressText(_T("Please wait....."));
pDlg->SetDlgTitle(_T("Connection progress"));
// Assign the thread window, with this dialog
m_pMainWnd = pDlg;
return TRUE;
}
int CProgressWndThread::ExitInstance()
{
// TODO: perform any per-thread cleanup here
return CWinThread::ExitInstance();
}
void CProgressWndThread::SetDocument(CRemoteAdminDoc* pRemoteAdminDoc)
{
ASSERT(pRemoteAdminDoc);
m_pRemoteAdminDoc = pRemoteAdminDoc;
}
void CProgressWndThread::SetProgressText(CString strDlgProgressTxt)
{
CProgressDlg* pDlg = static_cast<CProgressDlg*>(m_pMainWnd);
pDlg->SetProgressText(strDlgProgressTxt);
}
BEGIN_MESSAGE_MAP(CProgressWndThread, CWinThread)
//{{AFX_MSG_MAP(CProgressWndThread)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CProgressWndThread message handlers
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.