Write applications that can run on all Windows platforms

zhaozj2021-02-11  147

Write applications that can run on all Windows platforms

--- Excerpt from Software World 1995.11 The author is unknown, some changes in the original work, such as "string" to "thread", "conversation" to "dialog", etc. ---- Tsai ---- Windows 95 There is a very easy use of the PC and attract more and more people to use PC. This will lead to a huge demand for Windows applications and developers based on Windows applications. Windows 95 is more easy to use for application and WindowQS platform Higher integration, bring new sights and opportunities. Win32 and OLE2.0 for a high level, WINDOWS-based application developers need to consider five important factors when developing Windows 95 applications: the most important Two factors are WIN32 and OLE2.0. They are the basic construction module of the big Windows application for all platforms; the third factor is the developer to follow the USER Interface Design Guide developed for the future Window WS operating system, it The general controls and conversations are included; the fourth factor is the plug-and-play event tracking, which allows customers to insert only one device and open all the rest of the PC - system. The application written by developers should be The Plug-And-Play event is clear so that the application software can be placed well in Windows 95, and the insertion and unplugment of the device is clear;

The last factor is that the developer should use the supported information, long file name, and general naming conventions (UNC) path names, and file observator for the provided data type, making the developed application software and Windows95 shells It is well integrated together. Fortunately, the developer considers the application software after the above five factors can run on the Windows NT and Windows 3.1 operating system through the Win32 API. Not only that, the developed application can be WINDOWS NT Next Version Cairo runs. Win32:

An API, multiple platforms use Win32 QPI, users can develop applications that can run successfully on Windows 95, Windows NT, and Windows 3.x, which can still take advantage of the characteristics of the base platform. The main reason is that Win32 API Provides a set of upwardly compatible WIN32 features, information, structure, which run on the next version of Windows 95, Windows NT, and Windows 3.x or Windows NT. The basic capability of a specific platform determines the Win32 API Among them, all Windows platforms, including Windows 3.1 WITH WITH2, providing an environment for powerful features including 32-bit virtual memory management (Virtualalloc) and storage map files, Windows 95 and NT allow application writers to use some additional additional additional additional additional additional additional additional additional additional additional Functions, such as threads and long text names, Windows 3.x with win32s does not have these features. WindowsNT provides some additional features that Windows95 and Win32S, such as security and Unicode API. Because Win32S and Windows 95 remain non-supported Function, the user can use the getVersion function to detect the type of the base platform, so the functionality of different levels can be utilized in one execution (depending on the platform type). For example, the user can write an application, it is running on Windows 95 and Windows NT. Long file names and threads, provide 8.3 file names when running on Windows 3.x with WIN32s, and make threads are invalid. Unlike Windows-based 16-bit application software, Win32 application running on Windows95 and NT seizures multitasking You can also run multiple execution threads in their separation, protected address space. Win32 application software allows users to actually operate multiple tasks simultaneously. For example, users can compile, complex electronic data table core, file printing And single playing card game. For portable Win32 applications, from the perspective of development, the application software can access 32-bit strip storage space to avoid using segment storage space. Win32 API uses the current 32-bit processor, Allow applications to use new API innovations, such as paths, bozier, and threads. Win32 API can also be ported to non-Intel platform, such as MIPS R4000 / R4400, DEC Alpha AXP and PowerPC. This means that users only need to recompile and test applications, which can be run on multiple hardware configurations. Transplant existing Windows 16-bit application 4 is relatively easy to transplant in Win32. Facts. Facts On, accompanying Win32 SDK, a tool called PortTool, can scan the source code during porting Win16 application to Win32, and pointing out which code needs to be modified. PortTool's revision, already appeared in MS Development In Library, not only can software transplant, but also demonstrate how an application can use the unique feature of the foundation platform, and the dual can run on all platforms. Object connection and embed OLE2.0 version provide an end user with a The consistency method used to create a composite document makes the cross-application programming program a drag and drop function between applications and desktop computers. It also allows users to read extensive file information from the housing, such as icons, actions, and Application software itself. Windows95 is the first implementation of the MS to implement in the file-centric mode, operating system products on a personal computer. The purpose of Windows 95 pull-out development is to provide end user features defined by OLE2.0. Based on the basis and the current user starts using Windows 95, the use efficiency is high. In order to be well integrated with the Windows95 environment, the application should adopt OLE2.0 technology, such as composite files, drag and drop, visual editing, and automation. Application software uses a composite file and is called "Summary Information"

It is very important to reside in the file. Windows95 will provide information about the flow of information about the complementary information from the file from the outer casing. In addition, if the user registers OLE2.0, OLE class identity, etc. if the user is Suitable for file types, Windows95 can track which application creates which unambiguous file to get more specific information about OLE2.0 importance. User interface design guidance: Consistency and Integrated Windows operating system And a big advantage of Windows-based applications is consistent. After learning how to use Windows and at least one Windows-based application, familiar with a new application is relatively easy. Consistency has also built an internal The environment allows people to focus on their data instead of application software and housing. Another advantage is that User Interface Design Guide, which describes how to design software running on the Windows operating system. It is to promote based on The visibility and functionality of the Windows software and the software. The enhancement of the Windows interface function is designed from the basic graphical user interface design to the more object-oriented user interface, and the object-oriented user The interface is centered on data instead of application software. This setting is the continuation of the direction of OLE. Development and designers may need to reconsider which basic components (objects) should be reconstructed in the interface and Operation and attributes of objects. Although applications are still important, they are no longer the focus of users. Users should be able to interact with their data without considering how to start an application, so users can take attention Concentrate on their tasks. Applications can automatically use many new visual tools to issue standard WIN32 API calls. For example, a new title strip with left-signed title text will appear in application software, for application software The components do not make any modifications. For other standard Windows controls, the situation is the case. However, if developers develop a user control application software, developers should understand design guidance, consider using new general controls and dialogs. Win95 introduces several new WIN32 APIs, supports the general controls and dialogs. Make new visual user interface features. The new general control includes toolbar, state strip, column headings, standard Tabs, slide (Slider), progress display (Progress I Ndicator), rich text control, table display, and tree display. There will also be some modifications to add some supplementary functions, and existing universal dialogs include Open, Save AS, and Print Setup. The application software of the dialog should continue to do so. When Win95 and NT Cairo are equipped with redistribution Dynamic Library (DLL), the new general controls and dialogs via the DLL also apply to the current version of Win32S and WINNT. In this way Software can utilize new controls and dialogs, and can still run in all Windows platforms. Revised User Interface Design Guide, you can find new controls and dialogs and other-style application guides in development librage The PNP event:

Make PC more easily applied software to support new PLUG-AND-Play information. MS works closely with the manufacturer of PC systems and components to develop new PNP hardware design standards, which can realize device on PC system Automatic and dynamic configuration. PNP will become the standard feature of the MS operating system product, Win95 uses PNP function for the first time. Although PNP may look like hardware system creation, it provides some key features that make the software intelligently In this way, in this manner, the general application will also be integrated with the Windows Department. When the hardware configuration is dynamically changed, for example, insert a fax modem, or the network adapter, the application software will receive Related information, and can use these new hardware capabilities without any intervention requested by the user interface. This design method makes PCs are intuitive to new and existing users. For example, when computer networks Remove, the application can remind the user to pay attention to the open file on the network. In addition, the application software may be concerned that the resolution changes in the scanning process (this change may occur on Win95). Also put there in different icons or bits Mapping, application software uses them depend on display resolution. Applications get WM_DISPLAYCHANGED messages, which can make the necessary updates. Another important feature is called slow connection, allowing application software to have intelligent knowledge of remote contacts. Such as If the application software is running on a computer connected to the network via a remote access service, the application software is very sensitive to the data from the network and auto storage files. Applications should also provide a Cancel, the application, the same In the way, the application software can monitor the Advanced Power Management (APM) information to detect if the system relies on battery operation. If the system relies on battery operation, in order to complete the background task application software, it can make a switch and the automatic storage frequency. If users add What happened to this feature, what happened to Windows NT and Win32?

For most of them, do not happen. Windows NT supports SlowLink support, like WIN32 running on Windows for Workgroup. However, Windows NT and Win32S current version of PNP and Unclear, so they do not propagate these messages. Windows NT Cairo will fully clearly, support all PNP signals and events. The shell supports Win95 to provide a single tool with all resources (files, programs, printers, and other facilities) Work, simplifies the work of system resources. Win95 combines a variety of different managers - Program Manager, File Manager, Control Panel, Print Manager and Windows Setup - and can organize all resources in a flexible level In the structure. For system resources, drag and drop function will be supported, a desktop area will be used to place the resources that are regularly accessed. The enhancements also include 5 readers, users can use the conditions for the application software that is not installed. Read the contents of the file. Win95 provides some standard file readers for the data type. However, users can also provide file readers for their own data types, or provide files with more features (such as copying and printing). Reader. The future version of Development Library will provide information about file readers. Win95 supports long files and UNC pathnamers (/ Server / share) make information browsing and placement. Application should use UNC paths Name, rather than the drive letter so that the file is opened in the network, and the next time the dialog is started under the condition that the user requests the user with the same drive letter, WinNT and WFW3 are still .11 has supported UNC path name. Win95 and Winnt support long file name, but users' application software will look at the 8.3 file name on Win32S. If the user uses the general dialog box, the user will automatically obtain long file name and UNC path name support, so All things to do by users are to ensure that the buffer is sufficient to store 255 characters long text names, plus a 260-character UNC path name. Users also need to register several critical items for his application, such as size The icon, the deficient mobility of the language menu, and the attribute page. Win95 will use these registration items to display the information about the user application software. Since the user already knows some of the important features of Win95 application software, the user already knows that 32-bit WIN95 applications can be easily designed, and the developed application can also run on WinNT and WFW with WITH W32S. Some things that are worth noting: 1. Check PortTool. 2. Use Win32 Many development tools such as Win32 SDK, VC for Winnt, Watcom C 95, Symantec C 6.1, BC4.0 or Pharlap TNT. 3. Press Windows95 Feature design application software, develop Win32 OLE2.0 supported application software. 4. First test the application on WinNT and Win32S, then on Win95. PortTool users can add many features to the base platform. These features include threads, enhanced ultrafocular, multimedia, communication, network, advanced graphics, security, and more. Users can take advantage of "Writing Great Win32 Applications" in DEV Library

Table Help determine the functions that each platform can provide. Users then you can decide which features to join in his application and how to make the application can be run in multiple platforms. By modifying portTool samples, threads. PortTool Make Win95 and Winnt support threads, but in Win32S runtime, it makes threads invalid. Similarly, PortTool can be displayed by Win95 housing when running on Win95. When the screen resolution changes, it also pops up the dialog box. To display the application software to react with PNP events. Of course, things you have to do far more than a dialog. Further, when PortTool is running on the NT system installed with a dual processor, it will Automatically utilize the advantages of the dual processor, each thread is uniformly assigned between the two processors. Outside, the portTool running on NT and Win95 supports long file name, and Win32s should use the 8.3 file name. All these can happen During an execution! The following shows how to detect the platform on the user's application and how to use the platform between platforms. These are very easy. When PortTool is running on Win3.x with Win32s, the following is taken from PortTool. C The background selection of the code snippet. // Get the OS version information, and store dWVersion = getVersion () in a global variable () ... // to handle different platform IF (dWNDOWS NT) {// Windows NT } Else IF (LOBYTE (DWVersion ())) <4) {// Win32S // Since the thread cannot be used, Background Porting is invalid ENABLEMENUITEM (GetMenu (hwnd), IDM_PortBkGnd, Mf_Grayed)} else {// windows 95} The Windows 95 code key begins. With the help of several tools, the user can transfer 16 Windows-based applications to Win32, support OLE's application, can also re-develop Win32, support OLE application software User in TERFACE Design Guide, users can prepare the application to develop Win95 under conditions using existing dialogs and correct understanding of new controls. Users can take advantage of "Writing Great Win32 Applications"

转载请注明原文地址:https://www.9cbs.com/read-6072.html

New Post(0)