创建线程

来源:互联网 发布:江南大学校网络教育 编辑:程序博客网 时间:2024/05/17 03:57

class CSpiderThread : public CWinThread
{
public:
    CSpiderThread(AFX_THREADPROC pfnThreadProc,ThreadParams *pThreadParams);    
    virtual ~CSpiderThread();

    static UINT ThreadFunc(LPVOID lparam);

    BOOL ThreadRun(ThreadParams *pThreadParams);
    BOOL m_bDone;

    void KillThread();
}

 

这样当

CSpiderThread* pThread;
    pThread = NULL;
    pThread = new CSpiderThread(CSpiderThread::ThreadFunc,pThreadParams); // create a new CSpiderThread object

就构建一个线程