Class CWin32Thread::
Start()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: SetPriorityNext page: Stop    Show member index
Public Function Declared in:
Win32Thread.h

'Declaration' icon -- Shortcut to top of page. Declaration

virtual BOOL Start(
    LPVOID pData);

'Description' icon -- Shortcut to top of page. Description

Start the thread pData - Custome user data to pass to the thread

'Function Body' icon -- Shortcut to top of page. Function Body

try
{
    if (GetThreadStatus()==tsStopped)
    {
        //Recreate the thread
        //Create the thread in suspend mode
        m_hThread=CreateThread(NULL,
                               0,
                               Win32Thread,
                               this,
                               CREATE_SUSPENDED,
                               &m_dwThreadID);

        //Check if created
        if (m_hThread)
            SetThreadStatus(tsSuspended);
        else
            //Can't run
            return FALSE;
    }
    else if (GetThreadStatus()!=tsSuspended)
        return FALSE;

    //Start the thread
    CGenericThread::Start(pData);

    //Resume the thread
    if (m_hThread)
        if (ResumeThread(m_hThread)!=-1)
            //We are running
            return TRUE;

    return FALSE;
}
ERROR_HANDLER_RETURN("Start",FALSE)

'See Also' icon -- Shortcut to top of page. See Also

Class Overview Class Overview  |  Public base class CGenericThread  |  Hierarchy Chart Hierarchy Chart


Get Surveyor!This web site was generated using Surveyor V4.50.811.1.  Click here for more information. Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003.