What is the best way to have my C# Compact Framework program running in the background on a Windows Mobile device ? I need to respond to different events, such as a text message arriving with a specific content. I would like not to start up any UI when the process is started, but just run in the background until UI is needed.
在Windows Mobile设备上运行后台运行C#Compact Framework程序的最佳方法是什么?我需要回应不同的事件,例如带有特定内容的短信。我不希望在启动进程时启动任何UI,而只是在后台运行,直到需要UI。
How can this be done ?
如何才能做到这一点 ?
2 个解决方案
#1
4
Just create the app as a Console app. If you need a message pump, you need to call Run without any parameters, and the CF doesn't have that. OpenNETCF's Application2 class in the SDF does. At that point you can raise a UI any time by creating and showing a Form as usual.
只需将应用程序创建为控制台应用程序。如果您需要消息泵,则需要在没有任何参数的情况下调用Run,并且CF没有。 SDF中的OpenNETCF的Application2类确实如此。此时,您可以随时通过创建和显示表单来提升UI。
You cannot create a true service for CE or WinMo with managed code because EE Hosting is not supported.
您无法使用托管代码为CE或WinMo创建真正的服务,因为不支持EE Hosting。
#1
4
Just create the app as a Console app. If you need a message pump, you need to call Run without any parameters, and the CF doesn't have that. OpenNETCF's Application2 class in the SDF does. At that point you can raise a UI any time by creating and showing a Form as usual.
只需将应用程序创建为控制台应用程序。如果您需要消息泵,则需要在没有任何参数的情况下调用Run,并且CF没有。 SDF中的OpenNETCF的Application2类确实如此。此时,您可以随时通过创建和显示表单来提升UI。
You cannot create a true service for CE or WinMo with managed code because EE Hosting is not supported.
您无法使用托管代码为CE或WinMo创建真正的服务,因为不支持EE Hosting。