What is WTL?

zhaozj2021-02-16  38

Introduction The quiet spread between WTLs has been more than a year, and it is based on ATL based on ATL, and it has caused an idea of ​​ATL developer community. These people start from ATL1.1, It has been writing UI code for the ATL control, but they find that their code is often a pure Win32 GDI code. I tell you that WTL is not much different. Is it disappointing? No, because ATL is just to COM Simple package, this is also the power of ATL. Yes, write ATL you must know from COM. You have more efforts to learn COM on ATL, which is too much. This is not enough. Energy spending in the learning class library itself, ignoring the COM library is completely different. WIN32 window technology and GDi. As long as you know, learn the WTL seems to be a clear body, and then simple. If you Don't understand these, then you'd better use VB to write UI code. What is it for all types of applications? Note that although you don't have a document / view structure like MFC, you have VIEWS. There are a lot of code in WTL to make you manage, and join your own code. WTL has AppWizard, allowing you to generate SDI, MDI and multi-threaded SDI program multi-threaded SDI with IE or Windows Explorer is very similar. It looks open a plurality of program instances. In fact, these windows belong to a process). In addition, your program can be based on the dialog, or based on the view. Vision can be based on CWINDOWIMPL can also be controlled, or even an HTML page in IE. You can choose whether you need a rebar, command bar (ce-like), toolbar and / or status bar. In addition, your program can Host ActiveX controls, as well as a COM server. There are several options regarding the option. WTL provides the splitter window class (such in one view you can have two windows) and Scroll window classes (so your window can be displayed "Small). WTL also has something similar to the MFC's updateui, but they are not very the same - the main difference is that you need to update the items need to be used by Macro shot, then join the execution of Updateui in your class Code. DDX / DDV is also supported in WTL, similar to MFC, but there is different. You must add a macro shot to implement DODATAEXCHANGE, then join the code called it. Now WTL also has a GDI class. However, HDC packages Like CWindow, only very simple packages - It has almost no new features. However, in WTL, you can get playing meta files and OpenGL support. The most valuable me guess should be those inheritance classes of the printer DC - WTL has printer support, or even print preview. Of course There is also a package of GDI objects. Such as a brush, a painting, a region, and more. WTL encapsulates all Win32 (and W2K) general dialogs. Although it is simple, it does make it very simple. Synthesis Old ATLControls.h, added some packages. These packages encapsulate W2K controls, as well as some "controls that are not Win32," like Command Bar, Bitmap Button, HyperLink and Wait Cursor.wtl finally Into the ATL! Some new MSG mapping macro will separate the message, call the message processing function in your class. The value of the parameter of the message handler is separated from the message. The only headache is, you need to view the header file Determine the meaning of the function parameters. Finally, WTL has some practical classes. The most important thing is CString. Good, it is a copy on write, with (in the range I know) MFC version all methods There is also a package class of the Find file, as well as CRECT, CSIZE AND CPOINT. Summary If you intend to write a Win32 interface program, I suggest you try WTL before considering MFC. Use WTL to write your code, program It will become smaller and more efficient. Use WTL, you will also get ATL support COM benefits. And the MFC does not support COM. You can find wtl in the platform SDK in January 2000. In the MSI option page Source code section.

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

New Post(0)