From co COM

zhaozj2021-02-11  233

From to COM

-

Hou Jie

Summary:

This article introduces the basic concept of C Object Model and Component Object Model, and introduce

Four books:

INSIDE THE C Object Model

2. Essential COM

3. INSIDE COM

4. Understanding ActiveX and OLE - A Guide for Developers & Managers

For nearly 8 years, I will extends myself in the field of Windows, indulge in learning and research. I should

It is one of the lucky groups. In the age of PC software industry, step by step seizes technology.

Come. My ticket engineer, because of the post, but also to complete the project all day long

It can be obtained, it is really difficult to predict the time of experience, and the time of charging. There is a friend who is bitter from the overall technology

When the end of the wrong season, he said that if you can learn from step by step, how good it is! Another reader write

Let me say to me: I am immersed in the book. The taste is really a mood.

Unfortunately, the world will not wait for us. We have only taken the "Jumping Island Strategy".

In such a technological study in such a year, I feel like playing pictures. Started in the program,

The system ends, including C, C , Java, SDK, MFC, VXD, Win32 OS, Multithreading

, C STL, Internet Protocol .... I am looking forward to this puzzle, I feel all the changes in the outside world.

Almost in my hand in my hand. Regardless of the new development of the object orientation language,

What appl framework, or what new Driver Model, new protocol, I

I feel that because of the basic knowledge, it can be used by the class, and it is reversed in three. Even if you change one

I don't think I don't think of Processes, Threads, Modules, Address Space,

Executable File Format has made me easily easily. Yes, I feel

An unprecedented setting.

Then I examine my technical blueprint, I found that there was a blank without filling. That is actually a dream over the years.

What is called ole. The thing is growing from the world, constantly growing, and it has been like the big tree. it does not

However, the COM underlying architecture is divided, and more qualitants are added to the Internet in the Internet.

TIVEX.

In the past, I also had a lot of effort in the ole, and even some seem to have a good time.

Result. I often see the secret eyebrows and use when reviewing OLE books read before.

Word and PowerPoint have exquisite experience, and some of the duty, surprisingly found

I have also been drilled into such an extent. However, after a moment of intoxication, the heart is deep.

A small sound is asked to ask yourself: Why do you forget now?

● Know how to Know Why

Just like the supplement of calcium, it is important to absorb much, and how much is left. I have been forgotten repeatedly.

The COM / OLE technology is probably, I have not solidly set the relevant knowledge.

. I may learn a lot of how, but I don't know why. I don't have a way for the principle.

Keep the nourishment I absorbed.

This is abbreviated with the spirit of the research. But looking for a long time, I didn't find the ideal literature, and I can explain OLE (in fact, COM). I don't even know if I really have that.

Articles or books. In fact, I only need the most rooted part. I realized the most rooted part, I will be able to

Strength of yourself.

In a very accidental situation, I made two books, I finally integrated the advice to find out for the search.

thing.

It is accidental, why is it not guided by the peripheral knowledge of the month?

● Two good books

I have said two books are INSIDE THE COM. Please note

They are all talking Object Model, one for C , one for Components (Software Components)

).

In the past few years, I have had a lot of interest in the layout of C Objects in the memory, but also organize the virtual machine.

Some experiences in the underlying construction (I didn't know this knowledge field "at the time, I didn't know this knowledge field known as C Object Mode

l). So when I looked at INSIDE THE C Object Model three or two pages, Intuitive tells me, this is

It is a book I have always wish to have. In fact, it has been published for two years, I really have learned!

At the same time of the previous book, I also got the latest published Essential COM. The first two chapters of this book

The "why" of COM is exactly what I need. I feel that I need "why I need com" this topic needed

In the technical background, a lot is the range covered by C Object Model. And ESSENT

IAL COM's Don Box actually recommends INSIDE THE CET in the 16th page of the book.

Object Model book. Is this not enough? I have the recommendation and Don Box recommendation,

Two-section and happiness are difficult to describe.

This time, let me lay a from C Object Model to Component Object Mod.

The Avenue of EL.

● Overtar

I am afraid I have to use an inverted way to make you clear (and identify), why is learning the advertisement?

COM-independent of the language, but there is a very deep structure of a C language (belonging to the compiler)

Hierarchical basis.

Seriously think about this question: There are mfc20.dll, mfc40.dll, mfc41.dl in my hard disk.

L, mfc42.dll, mfc50.dll ..., why? I am too lazy to organize because of the version update.

Hard disc. Now I think, I saw it, but I dare to cut off them, just keep the latest version? I

Don't dare, because I am not sure which version of the application software uses DLLs. I would rather spend more spells.

Space to place all historical traces - anyway, hard disc is cheap!

A avoiding method is that do not use DLLS with DLLS, use a static connection (Stat

IC lineing) Forget! This is the best portrayal of "scrap food". Have this idea, I will walk into history.

The reaction. To know, DLLS is a reusable module, not necessarily because of the client.

The change is recompiled. In the opposite direction, if the DLL does not have to reconnect with the client (if the interface is not changed). Do not use DLLS, each application software will become a super big fat man, this is

One of the problems. Do not use DLLS, the development process of applying software will suffer significant hindrance, serious waste

Resources (especially memory), this is the two problems.

So the software engineers decided to continue using DLLs. Suppose I have a batch of DLL 1.0, decided to repair it after one year.

Change a Class, plus a private data. DLL 2 with 1.0

.0 is installed into the user's hard drive, the old DLL is overwritten. For new applications (DLL 2.0

The caller), this is certainly no problem. But when those applications that originally called DLL 1.0 are executed

The system may be changing!

why? Does C not support data package? Does the new DLL information are not private? Client

Never I can't access the information directly! Although the words are good, C is always on Private and PR.

OTECTED two reserved words provide language packages and do not provide binary levels (Binary Level

Package. The C compiler must have a complete master of the physical layout of the object (the mastery of the binary)

There is only a way to create an object entity; the above example has changed a private information to change

The entity's memory layout, the old Client call new DLL, huh, huh, improper is luck!

The solution is the current "Different DLL file represents different versions", like Microsof.

T is the same as what Visual C , Visual Basic. This is a saw arrow, avoided

Question, but there is no problem solving.

● Binary Level

Really to solve this problem, you must let the DLL of this end don't have to cause the Client end

Any variation. Real package, you must put "items like what" "and" how the object actually works.

It is completely separated. This principle is in a general C Object binary level (Bineary Leve

L) Unable to implement (why? Saying the length, this belongs to the category of C Object Model). But if

If we convert the original C Class to an Interface Class and a Implementat

The combination of Ion Class can do. The Implementation Class appears in the form of a DLL.

The interface class becomes a basic category of the Implementation Class, there is no

Data MEMBERS, only to open the Implementation Class Methods

Filler announcement. You guessed, these declarations are designed as pure virtual fifth. The pure virtual function is not

The only way is best practicing.

Interface Class is responsible for linking to Client and Object DLL (IMPLEMEN)

A fire lane between TATION CLASS, complete the so-called binary package!

In addition to the mild version of the conflict, another question is to be resolved. Since the C manufacturers have different practices for MANGLING (Vienname modified), there is no standard, Classes made in C platform A

DLL does not guarantee that it can be used in C platform B. The above put interface and importation

Separate processes can solve the problem of so-called compilers. Also, for Runtime Polymor

Phism is also helpful for Object Extensibility.

● So-called Components

Strive to be the so-called Objects that is protected by two-in-one anti-risley, and exempt from Name Mangling troubles.

Components. It is not limited to which C compiler to use, is not limited to which one is

Seedic language. In fact, Component Object Model is a specification, but this specification is the most

Purchase close to the C virtual fifth. SYSTEM Object Model in the same type

SOM) and Common Object Request Broker Architecture (CORBA).

I think you have already seen it, you have to know COM, only to learn about "why you need COM." To understand

What do you need com ", you must first understand why" C (or any current language) can't do it. " and

To understand why "C can't do it", you must understand what is "C object model".

■ Inside THE C Object Model

Author: Stanley B. Lippman

Publishing company: Addison Wesley

Publishing Date: 1996 Pages: 7 chapters, 280 pages

Sell ​​Price: There is no marking on the book (this book is no magneto)

Object Lessons

2. The Semantics of Constructors

3. The Semantics of Data

4. The Semantics of Function

5. Semantics of Construction, Destruction, And Copy

6. Runtime Semantics

7. On The Cusp of the Object Model

In the book heap of C into the sea, this is not infant milk powder, nor a larger baby milk powder.

It is a special low-fat high calcium special milk powder for adults.

I used to add some of C Objects in several C courses or MFC courses.

Digital image in memory and field layout, as well as the actual technology of virtual functions, the category

Part of the content, hidden THIS indicators ... etc., Very popular. These reactions don't take me

Expected: Engineers are eager to know what the bottom is.

Many people doubt why I know these underlying knowledge (some people think that I have a Microsof in the early years.

T or other company's back door pipeline - this is my friend listening to the lecturer in a technical seminar

In public). Part of these knowledge is from a wide variety of technical documents or a book or some article

It is obtained from the discontinuation of the discontinuation, and one is the actual write point of the small-range test.

I am a contour of the C object model in the way in the way, and it is very shallow. This INSIDE THE C Object Model did not discover at the end of 1997, which complete his shortcomings

Complete.

This appearance is inconspicuous, thin and narrow, much smaller than the large size of the general original text. Dry and thin

Skin, only 280 pages. "Condo" cover design plus micro-yellow paper, I can't afford me how much

interest. But the author's great name made me more about two eyes (Lippman has C Primer, with Bjarn

E Stroustrup's THE C Programming Language is already the third edition). This

I can't see it, I started a bit of "Irouting Poetry". Later in Essential COM

See Don Box recommended this book: "... Consult Stan Lippman's Most Excellent INS

Ide the C Object Model for a Great Discussion of Both Techniqies. "I

Agree to Don Box, this book is indeed "MOST Excellect".

This book is returned, not only the appearance, but also the same. The so-called C object model, the smelling

As if and what OOA / OOD is related. Lippman talked about its preface that the C object model has two cuts.

Addition:

1. Direct support for the object guidance design provided by the language

The Direct Support for Object-Oriented Programming Provided Withnin

Language

2. Used to achieve the underlying mechanism of the above support

The underlying mechanisms by Which this support is mentioned

This book is talking about the second entry point. If you have interested interest in the composition of objects and materials, the first chapter

Data of Object and Chapter 3 must be satisfied. Regardless of the way of inheritance is Virtual, Si

NGLE or MULTIPLE, the data attribute is Static, Global or LOCAL, this two chapters have a discussion

And in the key at the picture. If this part does not say in a picture, it is not worthy of my recommendation.

After all, it is necessary to conceive the layout of the data field from the text narrative, and they are committed to being too hard. This book is an intention

From the perspective of aesthetics, you can use "ugly" to describe, but it is enough to show the author's mind,

I can think about it.

If you have a few basic member functions such as Default Constructor, Copy Constructor, VI

RTUAL DESTRUCTOR, as well as under various types of functions such as Global, Virtual, Static

Interest, Chapter 2 of the Constructor, Chapter 4 of Function, and Chapter 5 "Construction,

Deconstruction and copying can definitely meet you. Chapter 6 Renew the Form, and talk about New and Delete two transport

operator. Chapter 7 Talking about the three extensions of C : Template, Exception, Runtime Type Ident

Ification (RTTI).

For each subject, Lippman covers the origin of the design, the evolution of the version, and both standards and practices.

The practice is proposed to propose the efficiency test results of different platforms (Platform) on certain topics. This book is basically written in a more academic way, so it is very much in terms of processing of data and the finishing of the test materials.

fine.

Speaking of academics, it should be a rigorous synonym. But this book has a pen error of about 100. I don't dare to mess

Said that Mr. Hou Junjie is translated by this book, he ranked a textured error, densely numb. one of them

C obvious syntax errors, compared to nobody, the killing power is limited, however the image symbol name is

The text narrative is inconsistent, or the diagram of the layout of the object layout is inconsistent with the declaration of the program code, which will seriously mislead readers.

Cardship. With this view, it is true, although there is beef everywhere, but some parts of cooking level,

Really damaged Lippman's reputation.

The thickness of the 280 page is like a tall dish with a full-time meal in the eight hundred pages of thousands of children today. But

Spicy, not practicing, not easy to cut. This is not a book of C beginners, for no items

Pressure, no test pressure, people with spiritual spirit, Hou Jie strongly recommended.

■ Essential COM

Author: Don Box

Publishing company: Addison Wesley

Publishing date: 1998

Pages: 7 chapters, 440 pages

Sell ​​Price: US $ 34.95 (no magnetic sheet)

COM AS A Better C

2. Interfaces

3. Classes

4. Objects

5. Apartments

6. Applications

7. Miscellanea

A. The Evolution of Objects

B. SELECTED code FRAGEMENTS

All software engineers who have a life in the Microsoft platform, no one knows COM / OLE / ACTIVE

The importance of x, no one does not want to understand and skilful this technology. There is no good book, such as I

NSIDE OLE (Fraig Brockschmidt / Microsoft Press / 1995) is almost every related

It is a classic to Bibliography or Reference. But the book is very similar to a "there are many"

The words of the word ", Hou Jie also climbed very hard.

For the reason, the early family is not enough for Object Model, and learning COM / OLE is very hard.

Slowly, everyone's books are much more, and use C / OO in actual development work, there are some experiences, then learn

Xi CoM / OLE, compare can get better.

Another reason is that COM can be pulled by the dragon to a good book, and it has been in place. I can't

Say that there is no such book, maybe it's a lonely. The crowd is looking for it thousands of Baidu, now it is coming, it is this

This Essential COM.

● About DON BOX

Author Don Box can be said to be famous in this area of ​​COM / OLE. He in Microsoft Systems

Journal (MSJ) host an ActiveX / COM Q & A column, which has long revealed outstanding strength. yield

I have two sequences of this book to give you a praise for Don Box. You are right, what is the preface?

The author's, happy family, but you can still feel the hurt and sincerely recommended between the words.

Differences between:

The first sequence: Charlie Kindel Com Guy, Microsoft Corporation If there is a book talk about com, DCOM, OLE or ACTIVEX, and I also read it, you almost

You will definitely find that my name is listed in the technical review column, as a reputation guarantee. I have written a lot myself.

This technical article, I am also the main editor of COM Specification. I have given countless

COM newsletter, regardless of the subject, technical personnel or non-technical personnel. Obviously, I spent a lot of time and energy

Attempting to find the best explanation method for COM.

When I read this book's final draft, I understand that all my efforts are in white. About COM, no

Who can explain better than Don Box!

Second sequence: grady booch

If there is too much book, it is worth mentioning twice. This is why DON this book has two orders.

because.

If you are building a system on Windows 95 or NT, you can't stay away from COM. If you

Want (1) understand what happens under the countertop (2) The power of using COM, this book is suitable for this book.

you.

I especially like this book is that Don is an organization mode when describing COM. If you read this book, you

If you don't know about COM, you will be guided by a clear and simple COM concept pattern, so you understand the problem.

The reason why COM is to obtain its structure and behavior. If you are an experienced COM

Developers, then you will especially appreciate that DON is solved with COM to solve some common problems.

Angle discussion.

Note that the penalty of the second order is Grady Booch, and the global object is guided by the masters.

● Why is COM

The full name of COM is Component Object Model, which is Microsoft to solve the conflict of soft version, the object is cross

Platform conflicts ... etc .; an object model designed and mainly pushed. It is a specification, while C

Abstract categories are close to this specification with virtual functions.

I believe that in learning how to use COM / OLE technology, everyone's doubt is the same: Why do you have

COM? Yes, it is said that the object-oriented technology, C is not provided with item package, inheritance, and multi-type characteristics.

Yet? What COM is coming?

The first chapter of this book allows you to clear your COM's design motivation, including Interface, Reference Count,

CreateObject .... As long as you know the C language, in the form, it is not difficult to see this chapter. Such as

If you have the foundation of C Object Model, the first chapter can give you a feeling of 醍醐.

The second chapter introduces COM Interfaces. A Virtual that the author has evolved in the previous chapter

Base Class At this time, the Base Class changed to become a functional pair COM iUnknown interface. This chapter

Shao IDL (an Interface Description Language), MIDL (a set of IDL compilers), GUID

(A 128-bit number that is not repeated by hundreds of millions of years), HRESULT (any platform for universal

Return type), IUNKNOWN (foundation of all COM Interfaces). Due to many COM PROGRA

Mmer cannot just call iUnknown's addRef and Release two-card, Don Box

Specially organized a good top ten Code, and provide an example to tell the reader which Code that is applicable. Very intimate!

The third chapter begins, this book will go in the direction of deep. At this time, I suggest you jump first and another book: Inside

COM, then turn back to continue to look at the chapter.

This book uses the word comparative academic (I mean hard). This will make unhefertable readers in the attack

The degree is blocked. Please pay special attention to the first two chapters, they are the key to learning COM. These two chapters have a system

Wave around an example, step by step. Unfortunately, this book is not attached to each level code in phases.

Abstract basic category design begins, then INTERFACE and IMPLEMentation separation, DLL

Join, Reference Counting Design, QueryInterface Design ...). I am strong

It is recommended that you have the desire and spirit of the actual, and the instructions in the book are close to COM. This is you

I may have a bitterness because I have not given all your information (such as the design of the Console DLL ..,

Basically, it is your necessary basis). Maybe you will be able to enter a small level, you can't get it.

. But in any case, you must try to do so, there will be the most practical gain. This is my real person.

This book-related program code can be obtained from Don Box's website, but does not include the COM mentioned above.

Each development phase of the backbone is actually used.

■ INSIDE COM

Author: Dale Rogerson

Publishing company: Microsoft Press

Publishing date: 1996

Pages: 12 chapters, 376 pages

Sell ​​Price: US $ 34.99 (including CD)

COMPONENTS

2. The interfaces

3. QueryInterface

4. Reference Counting

5. Dynamic Linking

6. HRESULTS, GUIDS, THE REGISTRY, AND OTHER DETAILS

7. The Class Factory

8. Component Reuse: Containment and AggRegation

9. MAKING IT Easier

10. Servers in EXES

11. Dispatch Interfaces and Automation

12. Multiple Threads

13. Putting it all together

This book is shallow, accurate, moderately, and a complete program is attached to each stage.

It is unfortunate that it is not good enough, and there is no analysis from the COM origin like Essential COM. In one case

The foundation of the beginning is not good, and the basic spirit of the whole CoM is shaken, and the advancement of the advancement is terrified.

I am afraid that I can't hit five.

My experience is that when I read the first two chapters of Essential CoM, they moved forward in their third chapter.

The knee is small, when the tongue is born, go back to see this inside COM, one night brush brush to see 13

0 pages (top six chapters), and master is quite good.

Every chapter of this book is in front of each section, the writing is very good, and the language of every sentence is also very

Clear (will not use a large string of a long string of clause connections), let us read smoothly, no need

Multi-spend my mind is in its articles, you can use all the spirit to deal with COM technology.

Take the Inside COM and Essential COM look up, you can maximize.

■ Understanding ActiveX and OLE - A Guide for Developers & Managers Author: David Chappell

Publishing company: Microsoft Press

Publishing date: 1996

Pages: 11 chapters, 328 pages

Sell ​​Price: US $ 22.95 (no disc)

1. Introducting ActiveX and OLE

2. The Component Object Model

3. Marshaling and Type Information

4. AUTOMATION

5. Persistence

6. Monikers

7. Uniform Data Transfer and connectable Objects

8. Ole Compound Documents

9. ActiveX Controls

10. Distributed COM

11. ActiveX, The Internet, And The World Wide Web

The submarket of this book tells us that it is a book that can give a manager. Since it is a manager

Write, there will be no too many CODE in the book, but it is more abstract text description.

I never believe that "abstract text description" can make people who do not have "the technical foundation" understand. I

Dare to die, yes, the above sentence is applicable to 99.99999% of the industry. So, this book

In fact, it is only suitable for engineers who have been trained by COM / OLE / ACTIVEX. You have already, you can understand

it.

The people who will understand, people who will not understand, then this book is not a bit of useful? Do not,

Its content is not bad, and there are some well-designed pictures, which can make our ideas clearer.

To amend some of the blurred, like and not blind spots we may exist. The book side is very careful

The focus of the paragraph text is a bit of the taste of the leader. Two-color printing, pleasing and pleasing.

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

New Post(0)