Component Object Model and ATL implementation

Source: Internet
Author: User
Tags object model web services xml parser

An overview

The appearance of Microsoft Component Object Model (COM) is an important progress in the development of software industry. Although up to now, it has mainly run on the Microsoft (MS) operating system platform. Whether you like it or dislike it, it is full of computing for the entire Internet and windows. COM is famous for its difficult to use, and with it is notorious for another Microsoft noun--activex, which we call a control. When you actually implement a polygonctl or Bulleye control in the sample code, you really understand a little bit of COM's ideas and methods. COM is the theory that ActiveX is technology. Familiar with the essence of COM, proficient in ActiveX programming technology, is a senior Windows programmer must do. (Someone mentioned MFC, unfortunately, this is a and VB should be discarded technology).

This article is not about what COM is, nor does it explain how to do ActiveX programming. What I'm going to describe here is how to apply COM technology to create something similar to Dom (Document Object Model). This is the problem of using COM to implement design patterns. What is a design pattern, plainly speaking, is a model-called the object model in the COM domain, which is composed of a set of interconnected COM objects that exist in the same type library, basically appearing as a DLL. For example, people who engage in geographic information systems are familiar with: Mapobjects (MO), Arcobjects (AO), Supermap, and so on. What are these things? They are the model-object models that are implemented using COM technology. Microsoft uses COM to implement the XML Parser standard for the consortium. An HTML file is instantiated within the browser (Internet Expolorer,ie) as a DOM model--a typical tree structure. People who use JavaScript are familiar with Windows, document objects that are components in the DOM. What I'm going to talk about is how to implement these things at the architecture level.

As a COM programmer (not just developing COM, I have to write Web Services, Web pages, JavaScript AJAX, OpenGL, aces, graphics algorithms, Oracle OCI, C + +, etc.), and must read through the following 3 books, This is also the main reference book of my article:

1) COM Technical Insider (Inside com--by Dale Rogerson);

2 ATL Technical Insider (ATL Internals--by Christopher Tavares, Kirk Fertitta, Brent rector, Chris sells);

3) COM essentialism (Essential com--by Don Box).

Among them, the 2nd book "ATL Internals"--Chapter 8th collection and enumerator--especially what you have to figure out, namely:

Chapter 8. Collections and enumerators.

The principle is very clear there, I just dots tell the reader how to apply. Because it is important to note that, as illustrated in the book "ATL Internals:working with ATL 8, Second Edition," there will be a case of compilation failure. So, my implementation may be helpful to you. Also, the system-provided collection index for the atlcom.h header file is starting at 1, which is just as inconvenient for the guy we used to start with 0 as it is for right-handed people to eat with their left hand. I also changed it to 0-based.

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.