标题:线程问题
取消只看楼主
求智者
Rank: 2
等 级:论坛游民
帖 子:39
专家分:32
注 册:2012-2-14
结帖率:90%
已结贴  问题点数:20 回复次数:0 
线程问题
#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
应给如何修改
搜索更多相关主题的帖子: another include thread return count 
2012-03-30 15:39



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-364806-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.532872 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved