| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 666 人关注过本帖
标题:线程问题
取消只看楼主 加入收藏
求智者
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
快速回复:线程问题
数据加载中...
 
   



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

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