//
# include "stdafx. H"
# include "ThreadCreate. H"
# ifdef _DEBUG
# define new DEBUG_NEW
# undef THIS_FILE
The static char THIS_FILE []=__FILE__;
# endif
/////////////////////////////////////////////////////////////////////////////
//The one and only The application object
CWinApp theApp;
using namespace std;
Void ThreadName1 ();
The static HANDLE hHandle1=NULL;//used to store the thread returns the handle to variables,
DWORD dwThreadID1;//variable used to store the thread identifier,
Int _tmain (int arg c, TCHAR * argv [], TCHAR * envp [])
{
Int nRetCode=0;
HHandle1=CreateThread ((LPSECURITY_ATTRIBUTES) NULL,
0,
LPTHREAD_START_ROUTINE ThreadName1,
(LPVOID) NULL,
0, & amp; DwThreadID1);
Sleep (5000);
The CloseHandle (hHandle1);
ExitThread (0);
Return nRetCode;
}
Void ThreadName1 ()
{
Printf (" Thread is running! \n");
}
This is operating system thread creation experiment, the code is no problem, that part is the header file, always say I can't find all files, I don't know is what circumstance?? Master explained ahhh, paying in a few days,
CodePudding user response:
Which header file can't find? A detailed message?Try a reference directly to remove the header file
CodePudding user response:
The paper checks the head right