网上找了半天没找到

解决方案 »

  1.   

    CWinThread* AfxBeginThread( AFX_THREADPROC pfnThreadProc, LPVOID pParam, int nPriority = THREAD_PRIORITY_NORMAL, UINT nStackSize = 0, DWORD dwCreateFlags = 0, LPSECURITY_ATTRIBUTES lpSecurityAttrs = NULL );lpSecurityAttrsPoints to a SECURITY_ATTRIBUTES structure that specifies the security attributes for the thread. If NULL, the same security attributes as the creating thread will be used. For more information on this structure, see the Win32 Programmer’s Reference.
      

  2.   

    自己设置SECURITY_ATTRIBUTES 的属性来控制线程属性
      

  3.   

    用AfxBeginThread建立的线程, 其函数的最后一个参数lpSecurityAttrs 来指定线程的安全属性,
    默认为NULL值,按照CreateThread 函数的说明:  The new thread handle is created with THREAD_ALL_ACCESS to the new thread. 
    If a security descriptor is not provided, the handle can be used 
    in any function that requires a thread object handle
    也就是说AfxBeginThread最后的一个参数指定为NULL,那么建立的线程即有THREAD_ALL_ACCESS 安全属性。详见
     CreateThread Res节。