简体   繁体   中英

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. 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.

This question are related to the client application (Windows Form). This application are using Sql Server Express Edition for data storage. The data is stored in XML object format. It also can transfer a data from client to server via web service. 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.

There is a new requirement to use a Handheld device which is use a Windows CE platform. 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? 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.

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.

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.

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.
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).

As others have mentioned, .NET Compact Framework is the way to go.

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". So for example you go to WaitHandle Methods, you can see that WaitOne is supported, but not WaitAny or 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 .

This edition of the framework is designed to work on embedded devices and windows CE.

And the database technology you are looking for is SQL Server Compact Edition (aka 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. So be sure you close your database connections neatly (use a finally clause!).

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:

  1. sllllooooowwww (the graphics accelerator is not available or something)
  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

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 ... :(

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM