简体   繁体   English

是否可以在Windows CE平台上运行我的Windows窗体应用程序?

[英]Is it possible to run my Windows Form application in Windows CE platform?

I am new in Windows CE development and never done it yet. 我是Windows CE开发的新手,还没有完成它。 Need some advise from the expert in here. 在这里需要专家的一些建议。

In our current project, we are developing a client-server application. 在我们当前的项目中,我们正在开发客户端 - 服务器应用程序。 The client side is using a windows form application that are base on Windows XP OS while the server is a web base application. 客户端使用基于Windows XP操作系统的Windows窗体应用程序,而服务器是基于Web的应用程序。

This question are related to the client application (Windows Form). 此问题与客户端应用程序(Windows窗体)有关。 This application are using Sql Server Express Edition for data storage. 此应用程序使用Sql Server Express Edition进行数据存储。 The data is stored in XML object format. 数据以XML对象格式存储。 It also can transfer a data from client to server via web service. 它还可以通过Web服务将数据从客户端传输到服务器。 It also interact with hardware such as Magnetic Stripe Reader, Contactless Smart Card Reader, and a thermal printer. 它还可以与磁条读取器,非接触式智能卡读卡器和热敏打印机等硬件进行交互。 Most of the communication between hardware device and systems are base on Serial Port. 硬件设备和系统之间的大多数通信都基于串行端口。 It is use standard app.config for the configuration and is a multi threaded application. 它使用标准app.config进行配置,是一个多线程应用程序。

There is a new requirement to use a Handheld device which is use a Windows CE platform. 使用使用Windows CE平台的手持设备有一项新要求。 This handheld included the required equipment such as Contactless Smart Card Reader, Printer and Magnetic Stripe Reader. 该手持设备包括所需设备,如非接触式智能卡读卡器,打印机和磁条读取器。 Instead of developing a new client application, is it possible to me to convert my current application that are base on Windows XP to Windows CE? 我可以将基于Windows XP的当前应用程序转换为Windows CE,而不是开发新的客户端应用程序吗? If yes, how can I do that? 如果是的话,我该怎么做? If no, is it any other brilliant suggestion to do this? 如果不是,是否还有其他明智的建议呢?

Thanks in advance. 提前致谢。 Software Engineer 软件工程师

Yes, it is possible using the .NET compact framework. 是的,可以使用.NET compact框架。

You have to realize, however, that the CF is a subset of the full .NET platform and the CE version of the CLR has different limitations than the desktop version. 但是,您必须意识到CF是完整.NET平台的一个子集,而CLR的CE版本与桌面版本有不同的限制。

You will be able to reuse much of your code, but you will have to spend a fair amount of time redesigning your UI and changing your code to get around differences and limitations of the compact framework. 您将能够重用大部分代码,但是您将不得不花费大量时间重新设计UI并更改代码以克服紧凑框架的差异和局限性。

It will require some effort to do so, but it's possible. 这需要一些努力,但这是可能的。 Windows Forms is not equal to the Windows Mobile one, since the Compact Framework is just a subset of the .NET Framework. Windows窗体不等于Windows Mobile,因为Compact Framework只是.NET Framework的一个子集。
Also, there will be some restrictions you should note, especially about memory allocation (WinCE limits to 32mb the memory to be allocated to a single application), threads and limited computing resources (in my company's application, for example, some screen changes are made by independent threads). 此外,您应该注意一些限制,特别是关于内存分配(WinCE限制为32mb要分配给单个应用程序的内存),线程和有限的计算资源(例如,在我公司的应用程序中,进行了一些屏幕更改)通过独立的线程)。

As others have mentioned, .NET Compact Framework is the way to go. 正如其他人所提到的,.NET Compact Framework是最佳选择。

A helpful hint: To determine if something is supported by the CF, there is a little handheld icon on the MSDN pages that if you scroll over says "Supported by .NET Compact Framework". 一个有用的提示:为了确定CF是否支持某些内容,MSDN页面上有一个小的手持设备图标,如果您滚动显示“由.NET Compact Framework支持”。 So for example you go to WaitHandle Methods, you can see that WaitOne is supported, but not WaitAny or WaitAll. 因此,例如,您转到WaitHandle方法,您可以看到支持WaitOne,但不支持WaitAny或WaitAll。 This could give you a better idea of how much you might have to change. 这可以让您更好地了解您可能需要更改多少。

这些API在Windows CE中有很大不同,某些方面可能很容易移植,但可能需要进行大量修改。

It is possible, but you will have to limit yourself to what is available in the .Net compact framework . 这是可能的,但您必须将自己限制在.Net紧凑框架中可用的内容。

This edition of the framework is designed to work on embedded devices and windows CE. 此版本的框架旨在用于嵌入式设备和Windows CE。

And the database technology you are looking for is SQL Server Compact Edition (aka SQLCE). 您正在寻找的数据库技术是SQL Server Compact Edition(又名SQLCE)。

An SQL CE database instance is a single file (.sdf) on the local file storage (much like the old Access Database stuff) and does NOT run as a separate service. SQL CE数据库实例是本地文件存储上的单个文件(.sdf)(很像旧的Access数据库内容),并且不作为单独的服务运行。 So be sure you close your database connections neatly (use a finally clause!). 所以一定要整齐地关闭数据库连接(使用finally子句!)。

From a brief reading of your app context I don't think you are going to have a massive multi-acess/connection pooling problem, though. 从简要阅读您的应用程序上下文,我不认为您将有一个巨大的多访问/连接池问题。

Annoyances about the Windows Forms stuff on WinCE: 关于WinCE上的Windows窗体的烦恼:

  1. sllllooooowwww (the graphics accelerator is not available or something) sllllooooowwww(图形加速器不可用或其他东西)
  2. labels do not auto size, readonly multilne textboxes are something one sometimes falls back on 标签不会自动调整大小,只读多文本文本框有时会依赖于它
  3. text on buttons does not word wrap 按钮上的文字不会自动换行
  4. animated GIFs are not supported on PictureBoxes PictureBoxes不支持动画GIF

By the time you have revised code running on your device you will find it very hard to port back, so look to keep a new tree on your source control entirely ... :( 当你修改了在你的设备上运行的代码时,你会发现它很难被移植回来,所以期待在你的源代码控制上保持一个新的树...... :(

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否可以通过控制台应用程序运行Windows窗体应用程序? - is it possible to run a windows form application with the console application? Windows CE Form错误 - Windows CE Form bug Windows ce +应用程序开发 - windows ce + application development Windows 表单应用程序在 Windows 托管服务上运行 - Windows Form application run on Windows hosting service 在我的控制台应用程序仍在运行时运行Windows窗体 - Run a windows form while my console application still running 我是否可以在我的 c# windows 表单应用程序中打开 windows 的本机应用程序(例如 Microsoft 白板)? - Is it possible for me to open a native application (Example Microsoft Whiteboard) of windows in my c# windows form application? 在Windows CE 5上安装我的程序 - Installing my program on Windows CE 5 是否可以在 Windows 窗体应用程序中创建第二个应用程序? - Is it possible to create a second application in a windows form application? 如何在Windows窗体应用程序中单击按钮时运行另一个Windows窗体 - How to run another windows form on button click in windows form application 是否可以在 heroku 平台上运行 Windows 服务/应用程序(c#)? - is it possible to run windows service / app (c#) on heroku platform?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM