线程问题
#include "stdafx.h"#include<stdio.h>
#include<windows.h>
#include"windef.h"
DWORD WINAPIThreadProc(LPVOID lpParam)
{
int i=0;
while(i<20);
{
printf("I am from thread,count=%d\n",i++);
}
return 0;
}
int main(int argc, char* argv[])
{
HANDLE hThread;
DWORD dwThreadId;
hThread=::CreateThread(
NULL,
NULL,
ThreadProc,
NULL,
0,
&dwThreadId);
printf("Now another thread has been created.ID=%d\n",dwThreadId);
::WaitForSingleObject(hThread,INFINITE);
::CloseHandle(hThread);
return 0;
}
F:\程序\03THeadDemo\03THeadDemo.cpp(27) : error C2664: 'CreateThread' : cannot convert parameter 3 from 'unsigned long (void *)' to 'unsigned long (__stdcall *)(void *)'
None of the functions with this name in scope match the target type
应给如何修改