[UWP] [DesktopBridge]使用命名管道在UWP和CPP应用程序之间进行通信? [英] [UWP][DesktopBridge] Using a named pipe for communicating between UWP and CPP app?

查看:285
本文介绍了[UWP] [DesktopBridge]使用命名管道在UWP和CPP应用程序之间进行通信?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在似乎可以使用命名管道:



" Windows 10,版本1709: 管道仅在app-container中受支持;即,从一个UWP流程到另一个UWP流程,它是同一个应用程序的一部分。此外,命名管道必须使用语法"\\.\pipe \LOCAL \"对于管道名称。" (来源:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365150(v=vs.85).aspx)





是否有使用此新功能的样品?我尝试在"https://github.com/Microsoft/DesktopBridgeToUWP-Samples/tree/master/Samples/AppServiceBridgeSample_C%2B%2B"中创建命名管道。示例(Win32Process_CPP.exe)。并使用"System.IO.Pipes.NamedPipeClientStream"从
连接到该管道的同一个包中的UWP应用程序。但它挂在"连接"... ...


任何见解都表示赞赏。



谢谢。$

It seems it's now possible to use a named pipe:

"Windows 10, version 1709:  Pipes are only supported within an app-container; ie, from one UWP process to another UWP process that's part of the same app. Also, named pipes must use the syntax "\\.\pipe\LOCAL\" for the pipe name." (Source: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365150(v=vs.85).aspx)


Is there any sample using this new feature? I tried creating a named pipe in "https://github.com/Microsoft/DesktopBridgeToUWP-Samples/tree/master/Samples/AppServiceBridgeSample_C%2B%2B" sample (Win32Process_CPP.exe). And connecting to that pipe from the UWP app within the same package using "System.IO.Pipes.NamedPipeClientStream". But it hangs on "Connect"...

Any insight is appreciated.

Thank you.

推荐答案

Microsoft希望我们使用WCF进行通信,以便他们更有可能提供样本那并支持这样做。 WCF可用于管道。

Microsoft wants us to use WCF for communications so they are more likely to provide samples of that and support for doing that. WCF can be used for pipes.

另请注意,您尝试执行的操作通常称为IPC。是的,微软最初试图大幅限制UWP做IPC。因此,搜索IPC和UWP将有所帮助。

Also note that what you are trying to do is generally called IPC. Yes, Microsoft did initially try to significantly limit UWP from doing IPC. So it would help to search for IPC and UWP.


这篇关于[UWP] [DesktopBridge]使用命名管道在UWP和CPP应用程序之间进行通信?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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