如何使用匿名管道在windows api(和传递到gtk功能)? [英] How to use anonymous pipes in windows api (and pass to gtk function)?

查看:146
本文介绍了如何使用匿名管道在windows api(和传递到gtk功能)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要能够将表​​示fd(pipe fd)的int值传递给 gtk 函数作为第一个参数

  gint gdk_input_add gint source,
GdkInputCondition条件,
GdkInputFunction函数,
gpointer data);

我如何做,因为 CreatePipe 返回不是int的HANDLE?



感谢

要将 HANDLE 值转换为C文件描述符,请调用 _open_osfhandle


I need to be able to pass int value representing fd (pipe fd) to gtk function as a first parameter

gint gdk_input_add gint source,
         GdkInputCondition condition,
         GdkInputFunction function,
                       gpointer data);

How do I do that, as CreatePipe returns HANDLE which is NOT int?

Thanks

解决方案

To convert a HANDLE value to a C file descriptor, call _open_osfhandle.

这篇关于如何使用匿名管道在windows api(和传递到gtk功能)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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