我用的是vs2008进行编程,现在要使多个函数并发执行,即进行判断,如果有两个条件满足则执行两个函数,如果多个条件满足,则执行多个函数。
 windowsxp

解决方案 »

  1.   

    AfxBeginThread或CreateThread创建线程
      

  2.   

    CWinThread *m_pThread = AfxBeginThread(MyFun,pParam);UINT MyFun(LPVOID pParam)
    {
      //...
    }
      

  3.   

    AfxBeginThread创建线程是要将函数定义为UINT MyFun(LPVOID pParam)型,可是我要用的函数类型为
    void fnution(int x,int y,int z)时要怎样做啊?谢谢!
      

  4.   

    在MyFun中调用你的void fnution(int x,int y,int z)楼主的结帖率:63.64%
      

  5.   

    我要对话框中创建了Edit Control控件输入参数且对应控件添加了变量date,那要怎样将date变量的值传到线程调用的函数啊??
      

  6.   

    CWinThread *m_pThread = AfxBeginThread(MyFun,pParam);UINT MyFun(LPVOID pParam)
    {
    }
      

  7.   

    我创建线程后将结构体变量的值传给线程函数时会出现错误,我调试发现我输入的值没有传到线程函数中是为什么啊?代码如下:
    HANDLE ThreadHandle;
            // LPVOID CompletionPort1;
     point pt1;//定义结构体变量
     pt1.x=times;
            pt1.y=uptime;
    pt1.z=downtime;
    //CompletionPort1=&pt1;
    ThreadHandle = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)ServerWorkerThread,&pt1, 0, NULL);   
          // {    
         //  printf("CreateThread() failed with error %d", GetLastError());    
          //  return;    
          // }   
             // Close the thread handle    
           CloseHandle(ThreadHandle); 
    DWORD WINAPI ServerWorkerThread(LPVOID CompletionPortID)
    {
    point *point=(struct point *)CompletionPortID;
    fun(*point);
    return 0;
    }
      

  8.   

    point pt1是什么变量啊,是局部变量当然不行了哦,用全局变量或new一个嘛,看来楼主对线程还很不了解啊
      

  9.   

    哦,我定义的是局部变量,这个问题解决了,谢谢各位了!还有一个问题是怎样使date time picker控件显示实时时间啊??我在网上找到一些资料说是用定时器设置,用SetTime()函数,添加WM_TIMER消信函数,这个我还是不太清楚要怎样做,各位能不能帮忙说的详细点啊??谢谢!!!