ATL introduction (1)

Source: Internet
Author: User

ATL introduction (1)

Lu Siwei-Pan aimin

1. What is ATL?

----1. com development and local limitations

---- Since Microsoft launched the COM technology for the first time in 1993, the Open-mode development on the Windows platform has produced a huge change, A series of software component assembly techniques based on COM bring windows programming into the group assembly time. When the developers of Guangda developed software components for com, the difficulty of developing a technology on COM and the complicated details of it are also very inconvenient. COM programming is regarded as a highly unattainable technique, but it is easy to see. Developers hope there is a kind of COM development tools that can be used quickly and quickly to improve the efficiency of development and better use this technology.

---- For this situation, after Microsoft company pushes the com SDK, it will simplify the COM programming and improve the efficiency of sending, the multi-party case was adopted, and the support for com and Ole was added to the MFC (Microsoft Foundation class. However, with the development of the Internet, the distributed component technology requires that COM components can be transmitted over the network, in addition, we have made every effort to provide a wide source of resources for your network. We need to find that the COM group parts developed by using MFC cannot meet this requirement well due to the limitation system, because Microsoft launched a new COM development tool-ATL in 1995.

---- ATL is the contraction of ActiveX template library, which is a set of C ++ template library. Enable the use of ATL to quickly develop efficient and simple code generation, at the same time, the opening and sending of COM parts is provided for the Generation Code self-generated with the maximum limit and can be regarded as support. For ease of use, Microsoft began to integrate ATL into the visual C ++ development environment from Microsoft Visual C ++ 5.0. Visual Studio September 1998, which was launched in 6.0, is integrated into the ATL 3.0 version. As a result, Atl has become a key member of Microsoft's standard release tool, and is increasingly valued by C ++ developers.

---- What kind of benefits does ATL bring to developers? This should start with the com release method before the ATL production starts.

---- Before the production of ATL, there are two main methods for developing Com group: first, use com SDK to directly Open Com group, another method is to implement it through the com support provided by MFC.

---- Using the com SDK for direct connection is the most basic and best-lived Method for sending COM components. We can directly compile the com program by using the development package provided by Microsoft. But yes, the difficulty and workload of this method are both large, I want to ask the attacker to have a deeper understanding of the technical logic of COM (although the deep understanding of the technology itself a work tool is not always beneficial, however, it is difficult to complete full-handed grip in a short period of time for a complex set of technologies such as com.) on the other side, directly enable the use of the com sdk to obtain the sender's own to implement each section of the COM application, complete a large amount of repeat work. The result is that the work efficiency is not only reduced, at the same time, the developers do not have to invest a lot of precision into the technical detail section on demand. Although this method is mandatory for some special applications, however, this programming method does not conform to the reusability promoted by the component programming method, using the com SDK for direct connection is not a reasonable method of development.

---- Enable the com support provided by MFC to open and publish com applications. In other words, the self-dynamic process is increased based on the use of com sdk, it is shortened from the start time. The MFC adopts the face-to-face method to encapsulate the com base function in the C ++ class of the dry MFC, the attacker can earn the com support by following these classes. In order to enable the dispatching class to obtain various features of the COM Object, there are many predefined Macros in MFC, the main functions of these macros are the fixed definition of the COM interface and the object note book, which are usually used in the COM object. The producer can use these macros to determine the characteristics of the COM object.

---- In addition, the support for automation and ActiveX control is also provided in MFC, visual c ++ also provides the Appwizard and classwizard support. This kind of visible work tool allows the developer to activate the com application.

---- MFC's support for com and Ole is indeed more advanced than that for manual compilation of COM. However, the support of MFC for com is not good enough and thorough. For example, for the IDL Language defined by the COM interface, MFC does not have any support, in addition, the new development of the COM and ActiveX technologies in recent years does not support the development of MFC. This is determined by the Base Release point of the MFC. MFC is designed as a face-to-face packaging for the compilation process of Windows platform. It is related to the aspect of the compilation process of windows, COM for the Windows platform programming, a part of the development is also supported by MFC, however, the support of MFC for com is based on the overall goal of its release point, because the support for COM must be served from its entire project. From this aspect, the support of MFC for com cannot meet the developers' requirements.

---- With the development of Internet technology, Microsoft has made ActiveX technology a key part of its network warfare, however, the ActiveX control developed with MFC is used to generate a large amount of redundant code, that is, the fat code ), and it must depend on the Runtime Library of MFC to perform the operation. Although the runtime Runtime Library of MFC only has the power of division and COM, It is the essence of the implementation of MFC, activeX control must carry the heavy-duty package license of the library during negative operation. For example, if you use static mode to connect to the library when using MFC, this will make ActiveX Control Code larger than Pang, when transmitting data over the network, it will take up valuable resources in the network. If the dynamic mode is used to connect to the MFC, this requires that the browser must have the support for the runtime of the MFC. All in all, the support of MFC for COM technology is also very ineffective in the environment where the network should be used.

----2. Objective of ATL

---- Resolving the question in the above-mentioned com method is the base object of ATL.

---- First, the Base Object of ATL is to enable com to be self-driven as much as possible by development, this base object determines that ATL will only provide support to com. The goal of the project clearly makes ATL's support for COM technology reach the best steps. ATL provides support for any of the ring sections and processes launched by com, it also integrates multiple tools related to the development of COM into a unified programming environment. For various types of applications of COM/ActiveX, ATL also provides good wizard support. All of these are very easy to use by developers, enable the producer to include the attention set in the series related to the application itself.

---- At this time, ATL took a large amount of redundant code due to its use of a specific basic real-time technique, use the code generation used by the COM application developed by ATL to simplify and improve efficiency, that is, the so-called "slim code generation" (Slim code ). ATL is able to use optimization techniques in real time, even in its internal part, it provides the replacement part of the C-start code that must be provided for all C/C ++ processes. At the same time, the codes generated by ATL do not need to depend on the large block of code generation that is required by similar MFC steps, the functions included in the package in the final module are the most basic and required by the user. These measures enable the use of COM components (including ActiveX Control) developed by ATL) it can be constructed based on distributed components applied in the network environment.

---- Article 3: each version of Atl has a good support for various new group technologies such as MTS and ASP of Microsoft Based on COM, ATL's responsiveness to new technologies is much faster than that of MFC. ATL has been developed as a master for Microsoft to support the development of COM, because the new COM technology will be reflected in ATL in a very short period of time. This enables the producer to Use ATL for COM programming, so as to achieve the same flexibility and strong performance as the direct connection for the com SDK programming.

---- The purpose of this article is to hope that in the limited frame, the reader can have a preliminary solution to the use of ATL and the basic principle., for the wide and large com developers, it is better to use ATL to launch the application of throwing bricks and causing Jade.

Ii. ATL Technology

---- Although it is a very simple situation to Use ATL to open com, however, it is behind the simple and easy-to-use interface of ATL, but it contains complex techniques. With the large amount of code generated by ATL, we can solve the meanings of these code without going into the ground, however, if we need to fully explore the potential of ATL and develop a more flexible and powerful com application, the basic technique used by ATL must be understood. The best teaching material of ATL is the ATL source code provided by Visual C ++. This section describes only the basic techniques used in ATL.

---- Simply put, the basic techniques used in ATL include the following aspects:

  • COM technology
  • C ++ Template)
  • Multi-Inheritance)

---- COM technology is the basis for understanding ATL, so that the use of ATL in the development of the basic concepts of COM technology has the lowest limit. Com is an unusual complex large technical system, limited to the content of this article, which will not be described here. There is no explanation for the basic concepts of COM mentioned in this article. Please read the reference books for the readers. The dashboard used as the core of ATL is an extension of the Standard C ++ language, however, in the context of a large number of C ++ programming languages, few people use it. This is because the performance of the model board is very strong, however, its internal mechanism is more complex than that of complex systems, and it requires more C ++ knowledge and experience to be able to use it flexibly. The cobjectarray and other energy classes in MFC are defined by the model board. The whole-body structure of the process sequence is defined through the dashboard. ATL is the most accomplished task today.

---- The so-called model board class is simply an image of the class. We know that C ++ uses classes to define the construction method of the object (which refers to the C ++ object instead of the COM object, the object is an instance of classes, while the template class defines the construction method of classes, the result of using the model board class to define instances produces different classes. As this can be said, the model board class is a "Class class ". (To be continued)

---- (Author's site: Beijing University Computer Science and Technology Research Institute, 100871; Draft date: 1999.08)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.