Createthread()例程函数返回类型? [英] Createthread() routine function return type ?

查看:95
本文介绍了Createthread()例程函数返回类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CreateThread()例程函数参数作为输入我想传递具有返回类型而非void的参数。我怎么做 ?



问题2.我也想传递参数。我怎么做 ?



总是最好的意图。先谢谢了。



我尝试了什么:



我试过搜索startPage.com但我没有找到任何满意的结果。

谢谢

CreateThread() Routine Function Parameter as input i want to pass parameter which has return type and not void. How do i do that ?

Question 2. I also want to pass arguments. How do i do that ?

best intentions always. Thanks in advanced.

What I have tried:

I Tried to search startPage.com but i did not found any satisfaction result.
Thanks

推荐答案

首先:你google Microsoft参考文档



要使用参数启动某些功能,您可以使用这样的包装函数:



First: you google the Microsoft reference documentation.

To start some function with parameter you can use a wrapper function like that:

void coolTheadFunc( void* data){
 //prepare the param
  DataStruct*params = (DataStruct*) data;
  myFunctionWithParams( ...);
}





点击一段时间后你会发现这个示例,如jeron所做的那样。



After clicking a while you would had found this example as jeron did.


KarstenK回答了问题2。 br />


你的第一个问题有点模糊。



ThreadProc的返回类型是DWORD。它不是无效的。



ThreadProc回调函数(Windows) [ ^ ]



如果你指的是ThreadProc参数,它是一个指向void的指针。只要函数的参数是指针,就可以将函数类型转换为ThreadProc。
KarstenK answered question 2.

Your first question is a bit vague.

The return type of a ThreadProc is DWORD. It is not void.

ThreadProc callback function (Windows)[^]

If you are referring to the ThreadProc parameter, it is a pointer to void. As long as your function's parameter is a pointer, you can type cast the function to a ThreadProc.


这篇关于Createthread()例程函数返回类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆