#include <windows.h>
#include <iostream.h>DWORD WINAPI Fun1Proc(
LPVOID lpParameter // thread data
)
{
cout<<"thread1 is running"<<endl;
return 0;
}void main()
{
HANDLE hThread1; hThread1=CreateThread(NULL,0,Fun1Proc,NULL,0,NULL); CloseHandle(hThread1); cout<<"main thread is running"<<endl; Sleep(10);
}/*
为什么输出是
main thread is running
main thread is running
thread1 is running
*/
#include <iostream.h>DWORD WINAPI Fun1Proc(
LPVOID lpParameter // thread data
)
{
cout<<"thread1 is running"<<endl;
return 0;
}void main()
{
HANDLE hThread1; hThread1=CreateThread(NULL,0,Fun1Proc,NULL,0,NULL); CloseHandle(hThread1); cout<<"main thread is running"<<endl; Sleep(10);
}/*
为什么输出是
main thread is running
main thread is running
thread1 is running
*/
解决方案 »
- 关于一个小“相册”
- 当从其他的类引用文档类时出现的错误
- CString定义数组,赋值后无法全部显示出来,不知是什么原因,请大家帮忙。
- 我是VC.net的初学者,想问如何生成一个.exe文件?
- 为对话框生成新类为何出错?
- 添加ACCESS数据DSN时,发生系统错误,说是“无法加载 ACCESS ODBC 数据源安装例程,因为存在系统错误180”,怎么解决??
- 哪里有介绍高质量数字减影算法的文章或资料呀??
- 如何解析HTML文件中的TABLE,并根据其原样用画出来?
- .net出来后com还要用吗?(请不要用砖头扔我)学了一下这东东好像很麻烦的样子,细节特别多。如果有一个更容易的代替它就好了。。。:)
- 如何发布VC做的项目?
- 最近看代码的一个问题?
- 关于在网页中调用MFC Activex
(有时输出对,有是错)#include <windows.h>
#include <iostream.h>DWORD WINAPI Fun1Proc(
LPVOID lpParameter // thread data
)
{
cout<<"thread1 is running"<<endl;
return 0;
}void main()
{
HANDLE hThread1; hThread1=CreateThread(NULL,0,Fun1Proc,NULL,0,NULL); CloseHandle(hThread1); cout<<"main thread is running"<<endl; Sleep(10);
}
http://topic.csdn.net/u/20090218/11/8FBEFB8E-F7AC-451F-8560-56ED04AD42A4.html