• 您的位置我爱Aspx >> VC.Net >> 基于MFC的编写线程快速入门
  • 基于MFC的编写线程快速入门

  • 作者:aspxer  来源:internet  日期:2007-5-21 23:49:14  关键字:
  • virtual int Run();

    //}}AFX_VIRTUAL

    // Implementation

    public:

    virtual ~CYourThread();

    // Generated message map functions

    //{{AFX_MSG(CEgClientCacheThread)

    // NOTE - the ClassWizard will add and remove member functions here.

    //}}AFX_MSG

    DECLARE_MESSAGE_MAP()

    }

    #ednif

    ////////////////////////////////////////////

    //实现文件YourThread.cpp

    #include "stdafx.h"

    #include "YourThread.h"

    #ifdef _DEBUG

    #define new DEBUG_NEW

    #undef THIS_FILE

    static char THIS_FILE[] = __FILE__;

    #endif

    IMPLEMENT_DYNCREATE(CYourThread, CWinThread)

    CYourThread::CYourThread()

    {

    m_bAutoDelete = FALSE; //注:该成员为CWinThread的成员,如为TRUE,在CWinThread::Delete()将删除线程

    //置为FALSE不允许自动删除线程自已

    m_hEventKill = CreateEvent(NULL, TRUE, FALSE, NULL);

    m_hEventDead = CreateEvent(NULL, TRUE, FALSE, NULL);

    我对这篇文章有话说?
  • 广告位招租,广告代号:content_468_15
  • 上一篇:使用C#制作的更换桌面背景程序
    下一篇:Serialization入门读物---PART1
  • 相关文章