m_BasAuthThread = CreateThread(NULL,0,(unsigned long(__stdcall *)(void *))BasAuthThread,(LPVOID)NULL,0,&dwThreadID);   m_BasAuthThread = AfxBeginThread(BasAuthThread,NULL,THREAD_PRIORITY_ABOVE_NORMAL);
这2个方法都不行的,谁有正确的方法?

解决方案 »

  1.   

    UINT BasAuthThread(LPVOID pParam);
    是这么定义的
      

  2.   

    BasAuthThread这个函数如果是成员函数必须加static标识符
      

  3.   

    BasAuthThread 定义了 static 就无法调用 其他的 普通函数了??怎么办?
      

  4.   

    老大能给一个 DLL 中 创建 THREAD 的例子嘛?
      

  5.   

    在创建线程时将this指针带进去就可以调用成员了m_BasAuthThread = CreateThread(NULL,0,(unsigned long(__stdcall *)(void *))BasAuthThread,(LPVOID)this,0,&dwThreadID);UINT CMyClass::BasAuthThread(LPVOID pParam)
    {
      CMyClass* pThis = (CMyClass*)pParam;
      // Call class member
      // pThis->...
    }
      

  6.   

    按照老大的方法做的error C2440: 'type cast' : cannot convert from '' to 'unsigned long (__stdcall *)(void *)'
            None of the functions with this name in scope match the target type可是报错
      

  7.   

    按照老大说的方法做的error C2440: 'type cast' : cannot convert from '' to 'unsigned long (__stdcall *)(void *)'
            None of the functions with this name in scope match the target type
      

  8.   

    CreateThread(NULL,0,(unsigned long(__stdcall *)(void *))BasAuthThread,(LPVOID)this,0,&dwThreadID);static DWORD BasAuthThread(LPVOID pParam);这样做可以了我想问下:这个动态库中的线程是否安全,如果 DLL 被多个人 LOAD 会出问题嘛?