Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of Modularization of C # Windows CE

2025-02-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you the modular example analysis of the characteristics of C# Windows CE. I hope you will gain something after reading this article. Let's discuss it together.

What is the modularity of C # Windows CE?

C # Windows CE is modular, which is necessary for a configurable operating system. The desktop version of Windows is developed and used as a separate set of files, but C # Windows CE itself is composed of modules (such as .exe application files and library files like .dll, etc.), and some modules are made up of two or more components (each component contains some functions of Win32 or some features of the operating system).

When the development team designs new devices, they can use a tool from Microsoft called Platform Builder7. Platform Builder allows third parties to customize their operating systems by adding or decreasing various modules according to the needs of specific smart devices. Do you need "Open File" and "Save File" dialogs when building the platform? It has such a module; do you need a display driver and a network driver? Platform Builder allows you to fine-tune the elements of the operating system so that you can have what you need. The .NET Compact Framework itself is one of these tunable Platform Builder components, that is, client devices can also include the .NET Compact Framework in their ROM8 images. For example, Pocket PC 2003 uses the .NET Compact Framework as a built-in component.

In our training sessions, people often ask about the differences and connections between Pocket PC and custom devices built using Platform Builder. The short answer is that their core operating systems are all the same. Therefore, it is feasible to migrate software between Pocket PC and other C # Windows CE devices. For Win32 programs, the crux of the problem is the need for a set of functions that support a variety of devices. If both devices using the C # Windows CE operating system support the same set of Win32 functions, Win32 programs or Microsoft Foundation classes (MFC,Microsoft Foundation Class), then the migration of the program will be quite easy. Cross-platform migration usually leads to compatibility problems, because a specific screen size, a specific CPU, a specific directory name in the installable file system, or another system status that should be queried at run time rather than hard-coded writing may have been assumed in the source code.

Pocket PC and Platform Builder

Pocket PC and Platform Builder are often mentioned in the questions of smart device developers. Can Platform Builder be used to create a custom operating system image for Pocket PC? Generally speaking, the answer is no. Developers can create custom Pocket PC operating system images only if they use special Platform Builder tools developed for the Pocket PC version. The security of Pocket PC devices needs to be guaranteed, because installing a new operating system on a given platform usually requires specific knowledge of that platform.

For developers, given smart devices, the configurability of C # Windows CE means that the operating system can be well tuned to include the exact set of features and functions you need. This nature is particularly useful for developers of closed platforms, which only the original development team can extend.

For other software developers, the configurability of C # Windows CE can lead to some potential problems and dangers. In particular, when developers develop software for multiple C # Windows CE platforms, they need to consider which Win32 functions are available for different platforms. This is important when developing Win32 programs, libraries, or development tools. Does the Open File dialog box exist? Which fonts are valid? What kind of display screen do different devices have? What should be done with platforms that do not have display terminals?

To help solve these problems, Microsoft defines a standard software development kit (SDK,Software Development Kit) in the Platform Builder of C # Windows CE 4.1. This SDK provides a valuable reference for multi-platform development. This standard will help advance the development of tool software that can be run on multiple platforms. This standard SDK defines a platform roughly equivalent to Pocket PC, although there are some differences between the two. At the same time, it also provides a starting point for the development of new platforms (most platform developers will be able to fine-tune their platforms so that their library files and function sets can meet the needs of a particular platform). Custom SDK can be exported from Platform Builder to provide a collection of library files for different platforms and a collection of files needed to build local runnable files for a specified platform.

The configurability of C # Windows CE is not necessarily a good thing for Win32 programmers. With configurability, it is inevitable that some platforms may not support the features or functions necessary for a particular program. The following text describes what happens when a required library file or function is missing.

Response to missing libraries and missing functions

How to respond to missing libraries or missing functions depends on whether the call is initiated by Win32 or the .NET Compact Framework. In native code, if the program references a missing DLL file, the program cannot be run, or the user will be given a prompt that the program or component cannot be found.

If all the necessary DLL that is called locally exists, but some referenced functions do not exist, the situation is different. An exception occurs when calling a missing function, but if the debugger is not running (the exception interrupts the debugger when running), the exception is ignored.

The requirements of the system for the .NET simplified Framework to call missing library files are looser than those for calling missing functions. When the module called by the .NET Compact Framework program does not exist, it can still be loaded, but when there is a call to the missing function in the .NET Compact Framework program, an exception occurs and if left unhandled, this exception will cause the program to terminate.

For .NET Compact Framework programmers, the potential problems caused by the configurability of the operating system are not too big a problem. These problems cannot go away completely now, because the .NET Compact Framework library must have support for the minimum Win32 feature set 9. Once this limit is crossed, however, this is no longer a problem for .NET Compact Framework programmers. This problem still exists because .NET Compact Framework programs can directly call local DLL files through platform invocation (this book will be introduced in Chapter 4).

Although C # Windows CE itself is highly configurable, the current version of the .NET Compact Framework does not have this feature. That is, any platform that supports the .NET Compact Framework should be able to run any .NET Compact Framework program. Therefore, for the time being, .NET Compact Framework programmers only consider the functions supported by the .NET Compact Framework itself when designing and developing software.

Because the configuration of .NET Compact Framework classes is static, it varies when coding according to the needs of different devices. For example, programs on Pocket PC are either full-screen or minimized, while other devices using the C # Windows CE operating system may allow multiple programs to run at the same time (similar to the desktop version of Windows). You can also take a look at the example of Smartphone, which reflects the limitations of program menus. * menus can only have two menu items, and only right-click menus can have submenus. These restrictions are necessary to maintain the consistency of the user interface, which provides two ways to access the program menu.

After reading this article, I believe you have some understanding of "modular example analysis of the characteristics of C # Windows CE". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report