我用Createthread 调用一个函数(该函数有2个参数 A,B  B是数组)  我怎么把这2个参数传给函数呢呢

解决方案 »

  1.   

    struct TTT
    {
       A;
       B;
    }
    传入结构指针 struct TTT*;
      

  2.   

    yourFunc(void* pPara)
    {
    ...
    }
      

  3.   

    typdef struct _tagParam 
    {
       DataType data1 ;
       DataType Data2 ;
    } FUNC_PARAM ;FUNC_PARAM funcParam = {dataValue1,dataValue2} ;DWORD threadproc(LPARAM lParam)//线程函数
    {
      FUNC_PARAM* pFuncParam = (FUNC_PARAM*)lParam ;
      YourFunction(pFuncParam->Data1,pFuncParam->Data2) ;
      return NULL ;
    }void YourClass::FunctionName
    {
       ::closehandle(::CreateThread(NULL,NULL,threadproc,&funcParam,...)) ;
       return ;
    }