m_hThread=CreateThread(NULL,0,&SendThread,this,0,NULL);
if(m_hThread==0)
AfxMessageBox("初始化出错!请重试");
线程建不了?

解决方案 »

  1.   

    估计你是在win9x上运行吧?在win9x运行,CreateThread最后一个参数,不能为NULL,这样:
    DWORD dwID;
    CreateThread(NULL, 0, &SendThread, this, 0, &dwID);
      

  2.   

    如果你的程序需要在Win98下运行,请在CreateThread的时候,最后一个参数不能为NULL,应该这样:
    DWORD dwThreadID;
    m_hThread = CreateThread(NULL, 0, &SendThread, this, 0, &dwThreadID);
    另外,你的第三个参数 &SendThread我怀疑也应该是SendThread, 不要加&的吧
      

  3.   

    上面两位dx说的对,是在98下,
    DWORD dwThreadID;
    但这个参数对我来说没用呀,直接定义一个没用就行是吧!