WTL architecture (1)

zhaozj2021-02-16  46

WTL architecture

introduction

WTL is finally coming, and it provides the function I want. I list the WTL main feature in WTL BYTESIZE (translated) article. In this article, I will describe the WTL architecture, and I will give some simple Example to demonstrate how to use it. I hope to help you.

WTL application type

WTL has several application types for you to choose from AppWizard.

The following table describes these applications. This elastic constitutes a part of the WTL architecture.

Application Type Description SDI Application Single text interface - only one window Multiple Threads SDI single process has one or more window MDI Application Multi-text interface - In the frame, you can have zero or more sub-window Dialog Based Based on dialog-based

You may still have a multi-threaded SDI application for the first time, but don't worry, its concept is easy to understand. It will have a window after the multi-thread SDI program starts, and the window shows a document. When you want the program to create another When a document, the problem will only display a document. In order to solve this problem, multi-threaded SDI creates another SDI window. It seems to be a new instance is running, actually it is just the original The process creates a new window and attached it to a new thread of the process. The new window of IE is doing this.

In addition to multi-threaded SDI, all of these applications can be used as a COM server, and the application wizard provides this option. In addition, the application wizard also allows you to specify whether the program hosts an ActiveX control. It is a puzzling Different program types, select "Host ActiveX Controls". Different. In addition to other types of dialog applications, the dialog type is placed in the second page.

Other options in the second page are available to the types other than the dialog program. They let you specify whether the program needs the toolbar, Status Bar and the View Window.

If you select the "Toolbar" option, you can choose whether to put the toolbar in the IE Rebar control via "Rebar". If you choose Rebar, you can pass the Frame Window member m_hwndtoolbar (detail later Description) to access it. You can add other toolbars in your own place. After "Rebar", you can decide whether to choose "Command Bar". Command bar is like CE's Command Bar control. Just WTL is implemented in a class, while in CE, Command Bar is a system window class. Command bar is very useful, it can join the window to the toolbar. If you choose this option, tool The strips and menus will be implemented as Toolbar. This allows menu items to have associated icons, and when you move your mouse to a menu item, the menu item will be set to high. From Office 97, Office The software's menus have the above features.

On the second page, there is an option for the specified program to use (mostly you want to use), and you can decide how these views are implemented. The following table lists all optional views.

Depending on the Generic Window a simple window. This window allows programmers to write a process function for WM_Paint messages. Suitable for documents that need to be directly Paint. The form has a dialog template. Suitable for windows with ActiveX controls. Application The program is operated. LLIST Box This is a list box. Its simplest form means that you can add a string by calling the addstring () method. Edit Control. Estate, it provides a Notepad Program. List view This is a list view universal control. Use this control to display related items (for example, the control panel is a List view of an Explorer, all items are control panel applets .tree View This is a Tree View General Control. This applies to data with hierarchical relationships. For example, you can use it to display the Schema of the database. Top branch is a table and stored procedure, the secondary branch is a field in the table. Rich Edit This is a Rich Edit control. Like WordPad.html Page, this will host an IE Web Browser control. It regards a hosted a web page as a view. This article requires a dialog template, but also a menu, so Form View is an ideal choice.

(Endlessly)

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

New Post(0)