我用Createthread 调用一个函数(该函数有2个参数 A,B B是数组) 我怎么把这2个参数传给函数呢呢 我用Createthread 调用一个函数(该函数有2个参数 A,B B是数组) 我怎么把这2个参数传给函数呢呢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 struct TTT{ A; B;}传入结构指针 struct TTT*; yourFunc(void* pPara){...} 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 ;} 求教个问题 Windows系统没有发出WM_ERASEBKGND消息 创业坚难百战多 cannot convert parameter 2 from 'class CString' to 'const char *' VC6.0有没有性能测试工具 SOCKET 文件下载问题 基于CFormView类的对话框工具栏变灰问题 如何给JPG图片加上水印? 用sendmessage传递字符串 为什么为什么为什么!发誓要给500分!解决了另外开贴子给分 请在Visual studio .net中用VC开发的高手进! 如何在一个CStatic上显示jpeg和gif图片?
{
A;
B;
}
传入结构指针 struct TTT*;
{
...
}
{
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 ;
}