什么是在Windows CE通讯跨进程的最佳机制? [英] What is the best mechanism for communicating cross-process in Windows CE?

查看:99
本文介绍了什么是在Windows CE通讯跨进程的最佳机制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要播出可以拿起由Windows CE 5设备上运行的任何应用程序的事件。

I need to broadcast an event that can be picked up by any application running on a Windows CE 5 device.

有没有这样做过,所以我会很希望了解的技术人员会建议,看看是否有什么我还没有考虑。

Haven't done this before so i'd be interested in knowing what techniques people would suggest to see if there is anything i've not considered.

所有需要接收此事件的应用是.NET Compact Framework的基础使管理,只有解决方案可以考虑。

All of the applications that need to receive this event are .NET Compact Framework based so "managed-only" solutions can be considered.

推荐答案

我发誓我已经回答了这个地方 - 在这里,新闻组,博客,东西 - 但我不能找到它,所以在这里要再次重申:

I swear I've answered this somewhere - here, newsgroups, blog, something - but I can't find it, so here it is again:

您真的有4个选项IPC在Windows CE。我将重点放在CF的解决方案在这里。

You really have 4 options for IPC under Windows CE. I'll focus on CF solutions here.

  1. 使用一个插座。这是一个痛苦样的作为事件源需要了解水槽的exxistence。这当然是我最不喜欢的选择,我用它靠近从来没有。
  2. 在已命名系统事件(一拉的CreateEvent的API)。这适用于简单的布尔类型的事件,如这是。 CE是很好的,你也可以关联32位值与事件(SetEventData)。对于管理的实施,看到这个博客条目 (实际的类是在SDF
  3. 内存映射文件。该自卫队拥有一个实现,我已经在一对夫妇的客户项目中使用,所以它的pretty的很好的测试。有一天,我应该做的关于如何使用它的博客文章,但你很聪明,可以容易算出它的文档。
  4. 点至点消息队列。这些都是CE特有的,但非常酷。内核使用它们了很多系统的东西。他们是非常快速和强大。此外,自卫队拥有一个实现 MSDN对使用记MSDN $ C的文章,但熊$ C中有一些错误的SDF有固定的。
  1. Use a socket. This is a pain as the event source kind of needs to know about the sink's exxistence. It's certainly my least-favorite option, and I use it close to never.
  2. A named system event (a-la the CreateEvent API). This works for a simple boolean-type event like "this is on." CE is nice in that you can also associate a 32-bit value with the event (SetEventData). For a managed implementation, see this blog entry (the actual class is in the SDF).
  3. A Memory Mapped File. The SDF has an implementation that I've used in a couple customer projects, so it's pretty well tested. Someday I should do a blog post on how to use it, but you're smart and can likely figure it out from the docs.
  4. Point-to-point message queues. These are CE-specific, but way cool. The kernel uses them for a lot of system stuff. They are very fast and robust. Again, the SDF has an implementation. MSDN has an article on usage, but bear in mind the MSDN code has some bugs in it that the SDF has fixed.

这篇关于什么是在Windows CE通讯跨进程的最佳机制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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