Your worker thread can be part of any class definition but remember to declare as follows:
public:
static UINT PerformShutDown(LPVOID pParam);
Sample member function that starts worker thread....
void CTestexecDlg::OnAbort()
{
/*****************************************************************************/
/* Variable Declarations */
/*****************************************************************************/
CWinThread * thread;
LPVOID pParam;
int nPriority;
UINT nStackSize;
DWORD dwCreateFlags;
LPSECURITY_ATTRIBUTES lpSecurityAttrs;
/*****************************************************************************/
/* Begin Main Function
*/
/*****************************************************************************/
//SetEngineStatus (0, 0); // Tell threads engine is shutting down
pParam = (LPVOID) this;
m_UUT1_ListBoxStatus.ResetContent();
m_UUT2_ListBoxStatus.ResetContent();
m_UUT3_ListBoxStatus.ResetContent();
m_TestUUT.ShowWindow(SW_HIDE);
m_TestUUT1.ShowWindow(SW_HIDE);
m_OnAbortUUT1.ShowWindow(SW_HIDE);
m_TestUUT2.ShowWindow(SW_HIDE);
m_OnAbortUUT2.ShowWindow(SW_HIDE);
m_TestUUT3.ShowWindow(SW_HIDE);
m_OnAbortUUT3.ShowWindow(SW_HIDE);
nPriority = THREAD_PRIORITY_NORMAL;
nStackSize = 0;
dwCreateFlags = 0;
lpSecurityAttrs = NULL;
thread = AfxBeginThread(PerformShutDown, pParam, nPriority, nStackSize, dwCreateFlags, lpSecurityAttrs);
}
Should be as simple as that......
Hope that helps.....
Steve