Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.

  • Apple
  • Android
  • Windows Phone
  • Android

To get the free app, enter your mobile phone number.

The COM and COM+ Programming Primer 1st Edition

4.0 out of 5 stars 23 customer reviews
ISBN-13: 007-6092006640
ISBN-10: 0130850322
Why is ISBN important?
This bar-code number lets you verify that you're getting exactly the right version or edition of a book. The 13-digit and 10-digit formats both work.
Scan an ISBN with your phone
Use the Amazon App to scan ISBNs and compare prices.
Have one to sell? Sell on Amazon
Buy used On clicking this link, a new layer will be open
$0.24 On clicking this link, a new layer will be open
Buy new On clicking this link, a new layer will be open
$49.99 On clicking this link, a new layer will be open
More Buying Choices
10 New from $39.99 27 Used from $0.24
Free Two-Day Shipping for College Students with Prime Student Free%20Two-Day%20Shipping%20for%20College%20Students%20with%20Amazon%20Student

The Amazon Book Review
The Amazon Book Review
Author interviews, book reviews, editors picks, and more. Read it now
$49.99 FREE Shipping. Usually ships within 1 to 2 months. Ships from and sold by Amazon.com. Gift-wrap available.
click to open popover

Frequently Bought Together

  • The COM and COM+ Programming Primer
  • +
  • .NET and COM: The Complete Interoperability Guide
Total price: $114.98
Buy the selected items together

Editorial Reviews

Amazon.com Review

Besides being one of the most readable and understandable guides to the Microsoft Component Object Model (COM) (and related technologies) ever written, Alan Gordon's The COM and COM+ Programming Primer also gives today's COM developer an up-to-the-minute guide to COM+, including excellent hands-on demonstrations of installing and deploying COM+ objects.

The best thing about this text has to be the author's extremely engaging writing style and clear explanations of thorny COM concepts, like interfaces, GUIDs, and other nuts-and-bolts issues that help make Microsoft's component standard tough-going for beginners. An experienced educator, the author makes use of clear examples and analogies--for instance, describing COM as a "software bus" where components can be shared across applications and projects. If you've been baffled by other books on COM, this book's easygoing presentation may do the trick. It also helps that the text traces each slippery term in the Microsoft COM marketing arsenal. It shows how labels like "OLE," "COM," and "ActiveX" have changed over the years.

After a comprehensive tour of the basics, The COM and COM+ Programming Primer turns toward distributed COM (DCOM) and then onto today's COM+. Several useful tutorials explain building COM objects using Visual C++, including using ATL wizards. When it comes to COM+, the text shows how built-in transactions, object pooling, and queued components can be used to create more scalable and reliable distributed applications. With plenty of screenshots detailing how to install and configure COM+ components, this book will let readers get going with COM+ in their own projects.

The COM and COM+ Programming Primer shows how basic COM has evolved into today's COM+ standard--not by getting rid of the basics, but by enhancing an already capable component standard with new middle-tier resources. This title provides an excellent introduction to basic COM for anyone new to this standard, and provides the latest on COM+--which will help more experienced readers take their skills to the next level. --Richard Dragan

Topics covered:

  • COM overview, advantages of components, COM as a "software bus," COM+ basics, and ActiveX and OLE
  • Object design with COM
  • Interfaces and objects
  • Basic COM objects with Visual C++
  • Using the Active Template Library (ATL)
  • In-process and out-of-process servers
  • OLE automation basics
  • COM callbacks and connectable objects
  • Threading (single, multiple, and thread-neutral apartments)
  • Distributed COM (DCOM)
  • COM+ architecture and system services
  • COM+ transactions, object pooling, and queued components
  • Three-tiered applications in Windows Distributed interNet Architecture (DNA)
  • Tutorials for developing and deploying COM+ components
  • Interception
  • COM+ events

From the Inside Flap


Teaching my class at UCLA, an Introduction to COM/ActiveX Programming Using Visual C++, has given me a good background from which to write a book on COM and COM+. The target audience for this book is the same people who took my class at UCLA: intermediate-to-advanced programmers who have little or no knowledge of COM or COM+. By the time you finish this book, you should have enough knowledge of COM to begin using COM and COM+ professionally. My Approach

My objective is to teach you the 90 percent of COM that, as an application developer, you will use every day. Most of this is surprisingly simple. But there is another 10 percent of COM that is very difficult to understand and this is the part with which I have often seen otherwise excellent programmers become bogged down. It's not that these "10 percent" topics aren't important, it's just that you can get started and begin using COM without understanding all of these topics. Some "10 percent" topics that immediately come to mind are Apartments, custom marshaling, aggregation in general, manual marshaling of interface pointers, and aggregating the Free-Threaded Marshaler. I do cover all of these topics in this book, but be forewarned you probably won't understand these topics the first time you try to learn them; I certainly didn't. But don't get discouraged and don't let topics like this "bog you down" as you try to learn COM. This is not what COM and COM+ is all about. COM is about making it simple for you to build location transparent and programming-language independent software components. COM+ is all about facilitating the development of enterprise-class, distributed applications. The objective of neither of these technologies is to aggregate the Free-Threaded Marshaler. Don't allow yourself to become lost in the minutia of COM as many people do. When I cover topics that I know tend to bog down people (like Apartments), I caution you to just keep going if you don't understand it right away. Please follow this advice. You will understand the other concepts as you begin using COM professionally and start tackling more difficult problems.

Visual C++ and Visual Bask
The primary programming language used in this book is Visual C++. The world seems to be turning away from languages like Visual C++ and to languages like Visual Basic, Java, and Delphi. Unfortunately these languages hide so much of the under-lying details of COM that it is difficult to understand what's going on under the hood if you only use these languages. Only in Visual C++ can you implement the IUnknown interface, and create your own class factory, as you will do in Chapter 4. I strongly believe that the additional insight that you gain by doing this is well worth the additional complexity. In addition, there are certain things that you can do in COM+ that you simply cannot do from Visual Basic 6, such as building an object that will run in the thread-neutral apartment and using object pooling. Once you understand COM+ using Visual C++, transferring your knowledge to a more productive development environment, like Visual Basic, will be easy. Don't worry; you don't have to be a C++ Guru to read this book. I really think that a beginning C++ programmer will have little problem following along with the code in this book. I do use Visual Basic to build some of the client programs. I mainly did this to save time. It is much easier to build GUIs with Visual Basic than Visual C++. In addition, using Visual C++ for server-side development and Visual Basic for client-side development is a popular combination that I have seen on a number of projects recently.

Use of the Word Component
If you read any books about COM you quickly see that the word component has two popular uses:

It refers to a binary file (a Dynamic Link Library or Executable) that implements one or more COM classes it refers to a single COM class

Personally, I prefer the first definition of the word mainly because I believe that a COM class adequately describes the individual pieces of functionality that may reside in a single binary. People who use component to refer to a COM class usually use component server or just server to refer to the binary in which several components may be hosted. When you start using COM+ you will see that Microsoft refers to COM+ classes as components (even though they are not completely consistent either). I'm hardly a zealot on these kinds of issues so I concede the argument for now. I think there still are a few places in this book where my old bias shows through. I believe that in all places it is obvious from the context whether I am referring to a single COM class or a binary file in which several classes reside. The Book's Structure

Of the 15 chapters in this text, eight chapters (1-8) are essentially pure COM, two chapters (9 and 10) are primarily COM with some COM+, and five chapters (chapters 11-15) are pure COM+. The simple reality is that you cannot understand COM+ without first understanding COM. COM+ is really just a vastly improved and more tightly integrated version of Microsoft Transaction Server along with some key refinements to the underlying COM infrastructure such as Thread Neutral Apartments. A book that only covered COM+ features would only be usable by people who understand COM already. I covered both COM and COM+ because I wanted this book to be usable by people who are new to COM. Having said that, I teach you only enough COM so that you can understand COM+. COM+ was designed primarily to facilitate the development of enterprise-class, distributed applications, so there are many COM topics (ActiveX controls for instance) that are not covered in this book because they have little relevance to enterprise-class development and COM+.

Most of the chapters start by explaining a problem that can be resolved by using COM/COM+. That is followed by a discussion of how the COM-related technology works and how you will use it. This discussion includes a lot of analogies, diagrams, and screen shots. Finally, in most of the chapters you build a demonstration program. I don't think any of the demonstration programs are terribly sophisticated (they weren't meant to be). The example programs are designed to reinforce the topic that you are learning in that chapter. I show you how to build the example program in enough detail that a beginning Visual C++ programmer (if you can work through the Scribble tutorial in the Visual C++ documentation you're good to go) should have no problems following along. I think you will learn the most by building the example programs yourself, but if you don't want to go through the steps yourself you can download the demonstration programs from the FTP site for this book ftp://ftp.prenhall/pub/ptr/windows_technology.056/gordon.

Part 1: Laying the Foundation
In the first chapter, I define all the names in the COM namespace. Confused as to what COM, OLE, ActiveX, and the Windows DNA are? Chapter 1 defines these names and more. In Chapter 2 you learn a number of object-oriented concepts that are important pre-requisites to understanding COM. In particular, you learn what it means to be object-oriented and I define a class, an object, and an interface. The discussion of interfaces in this chapter is particularly important. In Chapter 3 I define the notion of a software bus and use it to explain some of the intricacies of COM: GUIDs, the IUnknown interface, Type libraries, Marshaling, and how COM uses the registry. In Chapter 4 you build your first COM class in an in-process server. You do this "from scratch" without the help of any wizards. You also build a COM client application. In Chapter 5 you learn how to build a COM server much more easily using the Active Template Library (ATL) and the ATL Object Wizard. All of the work that you do from Chapter 5 on uses ATL and/or Visual Basic.

Part 2: Digging Deeper In Chapter 6 you learn how to build an out-of-process server. In Chapter 7 you learn about Automation. In Chapter 8 you learn about connection points. These 8 chapters are the pure COM material in this book. In Chapter 9 I discuss COM threading and Apartments. This chapter features some material (primarily Thread Neutral Apartments) that will be new to COM programmers who have not used COM+. In Chapter 10 I discuss DCOM and again in this chapter I discuss, briefly, some new topics like the Kerberos Security Support Provider.

Part 3: COM+
Chapter 11 begins our discussion of COM+. In Chapter 11 I discuss the COM+ architecture. You learn about Context's and Interception. You also learn how to configure a component using the Component Services Explorer. In Chapter 12 you learn about each of the Services that COM+ provides to components: fine-grained security, transactions, concurrency, store-and-forward method invocation (queued components), loosely-coupled events, load balancing, improved scalability thru just In Time activation and pooling of objects, and database connections. Chapter 13 is a big chapter in both size and significance. In this chapter you put it all together and build a 3-tiered, thin-client application using all the technologies in the Windows Distributed interNet Applications (DNA) Architecture: COM+, Active Server Pages, ADO, SQL Server 7, Visual C++, and Visual Basic. In Chapter 14 you use Queued Components to enhance your application. In this chapter you also learn how to use the Microsoft XML parser. Finally, in Chapter 15 you learn how to use COM+ Events. The Intended Audience

You need to have at least a beginner's level knowledge of both Visual C++ and Windows Programming, in general, in order to understand this book. Also, the more you know about object oriented concepts, pointers, distributed processing, and multi-threading the easier time you will have learning COM. None of this knowledge is required to understand this book, as I do start from first principles. But trust me, the more you understand these concepts, the easier time you will have understanding COM, whether you learn from this book, another book, or a class. Conventions used in this book

This book uses different features to help highlight key information. These features are discussed in the following sections.

Code Presentation
You will notice that there are three types of code listings. Some do not have a listing number, some have a listing number, and some have a listing number and numbered lines. Code that does not have a listing number is usually a short snippet that is included to illustrate a point.

Sidebars are used to present parenthetical information: information that is related to the topic at hand but does not flow directly with the main body of the chapter. In a few cases, I also use sidebars as a soapbox where I present information that is strictly my opinion, such as when I discuss my idea for a new COM naming scheme in Chapter 1. If you put a "by the way" or a "for your information" before each sidebar then you've got the idea.

Notes are used as small sidebars. Whenever I want to present parenthetical information that consists of only a sentence or two, I make it a note.

Tips are used to provide recommendations or to present information that can either save you time or prevent you from encountering minor problems.

Warnings are used to present information that is so important that I want it to stand out. I also use warnings to inform you of things that you must do to avoid serious problems. It is particularly important for you to pay heed to warnings that are associated with the example programs. In most cases, not following the warning will cause the example program not to work. About the FTP Site

The FTP site for this book can be found at the following URL: ftp://ftp.prenhall/pub/ptr/windows_technology.056/gordon. The FTP site contains the errata for the book. It also contains the source code for all the example programs in the book. If you do not wish to build the example programs yourself, or you encounter problems building the examples, you can download the finished programs from the FTP site. Acknowledgements

My name may be listed as the sole author of this book, but it took the work of a team of people to make this happen. Let me begin by thanking the people at Prentice Hall who were directly involved in the production of the book: my acquisitions editor, Tim Moore, my developmental editor, Jim Markham, and my technical reviewer, John Vacca. Special thanks to Jim for being so patient with me. Thanks also to Scott Suckling and the team at MetroVoice who did the final production work to turn my manuscript into the book you now hold in your hand. Next, I would like to thank all the people at UCLA Extension. It was through my work there that I was given the opportunity to write this book. Standout people I would like to mention are Terry Warner, Ben Stein, Carolyn Diliberto, Joseph Mueller, Donald Haushnect, and Robert Abnous. At Logicon's Advanced Technology Group I would like to thank everyone on the CAMPS project including Mark Flores, Rick Clough, Betty Hampikian, Curtis Enge, Marilyn Leatherwood, Theresa Millette, and Ward Keenan. I would like to especially thank everyone who worked for me when I was the technical lead on the Channels component including Bill Bulaich, Curt Miller, Sanjukta Chowdhurry, and Steve Caton. Others I would like to thank at Logicon include Roger Fuji, Vince Goshi, Steve Altstatt, Mike Twymann, and Steve Cooper. Many thanks to my lunch buddies at Logicon, Bill Bulaich and Paul Firnett. Since late August 1999 I have been working at a new company called FieldCentrix, fieldcentrix. This startup company is located in Irvine, California, and develops software for field service workers using the latest technology in wireless communications, rugged handheld PCs, and the Windows CE operating system. Those I would like to thank at FieldCentrix include Dave Key (the company founder), Dr. Albert Lin (who hired me), Paul Osterhoudt, Gaurav Jalota, Ashu Shende, Calvin Shen, Lap Tran, and Kevin Bates.

Many thanks to friends who have influenced me including: Dr. Quintus Jett, Dr. George Shaw, Dr. Shozo Koshigoe, Carlos Castellanos, and Ruel Nuqui. Next, I would like to thank my family. Kudos to my older brother Winston Gordon, Jr. When I was an Aerospace Engineering major at UCLA, he scoffed when I was learning FORTRAN-told me that C was the way to go. Eventually, I bought books on C and on C++. He started me on a journey that culminated in my writing this book. I would also like to thank my parents, Agatha and Winston Gordon, Sr. I can never repay you for all you've done for me so I say thank you. Other members of my family I would like to thank include Vera Littlejohn, Dr. Mary Marin, Alma Horper, Kaylah Marin, Mikalynn Todd, Amber Saucedo, and Sharine Dinwiddie. Finally, and most importantly, I would like to thank the two special women in my life: my wife Tamber Lynn and my daughter Bria Almarie. Thank you both for all the love and support you gave me and continue to give me, before, during, and after this book was written. You sacrificed so much to make this a reality. Thank you, Tamber, for encouraging me when I was ready to give up this project and I'm sorry for all the times I wasn't at my best while writing this book. Bria, forgive me for the times I couldn't play with you while I was writing this book. I hope one day you will understand that I did it to help build a better life for us. To anyone I forgot, my apologies and heartfelt thanks.


The latest book club pick from Oprah
"The Underground Railroad" by Colson Whitehead is a magnificent novel chronicling a young slave's adventures as she makes a desperate bid for freedom in the antebellum South. See more

Product Details

  • Paperback: 796 pages
  • Publisher: Prentice Hall; 1 edition (May 1, 2000)
  • Language: English
  • ISBN-10: 0130850322
  • ISBN-13: 978-0130850324
  • Product Dimensions: 7 x 2 x 9.2 inches
  • Shipping Weight: 3.5 pounds (View shipping rates and policies)
  • Average Customer Review: 4.0 out of 5 stars  See all reviews (23 customer reviews)
  • Amazon Best Sellers Rank: #785,844 in Books (See Top 100 in Books)

Customer Reviews

Top Customer Reviews

By John Price on June 14, 2000
Format: Paperback
I was asked to give a 2-hour overview of COM+ to the development staff at my company. I had just started learning and developing with COM+ a few weeks previously. I scoured the web for info, and other than the MS documentation, this book was the only one that contributed to my preparation. Extremely well-written and clear, but very very in depth. Aimed at C++ programmers (I am a VB person), but I still found it more helpful than any of the VB COM books I've looked at. Once I understood the internals of COM+, programming to the COM+ API was a snap. I finally really understand why VB components can't be pooled! The C++ guy on my team also used it to get his pooled component working correctly.
Comment 41 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
I've read several books in the past about COM programming/fundamentals - most of the books out there in the market jump into programming before clearly explaining the underlying concepts - THIS BOOK IS DEFINITELY AN EXCEPTION. The author explains all the concepts in-depth, he takes it one step further by not assuming that the reader is familiar with MicroSoft nomenclature and then walks through the examples. This book is a good start for a COM beginner, although there are typos/programming errors - the ftp site has all the compiled examples, so no problem there. This is one of the very few books available on the subject which you would not stop reading after the first 100 pages- if not anything, it gets rid of the COM fear :-) Read this book and start building simple COM examples along with the examples in the chapter - you will be on your way to COM/COM+ all by yourself with some help from MSDN ofcourse !
Comment 10 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
I contacted Prentice Hall about the FTP site not working, and they fixed the problem promptly -- the code samples are now available.
I've looked at other COM books, and this may be the most useful one available. It contains plenty of practical examples, and is written with more care than most recent programming books. Perhaps as a result of the ridiculous pace with which new tools and standards are being introduced in these hectic times, there's a tendency for authors to rush to get their books on the shelves first. I'm happy to report that this book is not a rush job; it's definitely a keeper.
Comment 8 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback Verified Purchase
For a COM beginner such as myself, this book provided a vital introduction to necessary concepts and techniques. The author wasted few words in conveying his information, and never talked down to us poor dummies.
I was particularly taken with the author's didactic technique of including at least 2-3 egregious typos or omissions in the examples at the end of each chapter.
To find the source code for these examples -- and unless you're already an expert, you *will* need the source code -- do not bother checking the url in the Introduction. Go to the Prentice Hall home ftp site drill down from there. END
Comment 10 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback Verified Purchase
Out of the last 6 COM books I've read over the past 3 months, this is by far the best and helped to clarify concepts in the others. I'd recommend this highly as a 1st COM book. Makes an excellent reference as well. The book is organized in a very logical and progressive manner that makes it not only helpful, but interesting as well. All concepts are made very clear, and plenty of other references are provided. I could actually start a COM project after reading this one.
Comment 7 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
If you really want to know what COM and COM+ is all about, this book is for you. I've tried some other COM books before that one, but still had hard time to understand the topic. It has a lot of real life examples and most of explanations are very clear. The only problem is that code from the book must be slightly edited some times to compile. Plus I found some typos. But still-EXCELLENT BOOK.
Comment 6 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
I have read many books on COM and COM+ and I would recommend this book as one of the essential books to bring any programmer into the world of COM and COM+.
Perhaps, it's because of the authors background as a teacher, I don't know, but this book takes EXTREME care in the organization and progression and just as importantly in the source code that goes with it. This really stands out compared with so many of the other books I have come across.
I could go on and on, but just to single out one source of praise, the author takes great care in telling the user how to set up the development environment. I have seen so many books that perhaps assume everything will work or that their readers are smart enough to figure this all out for themselves.
It was published in 2000, and Microsoft is moving everyone to .NET, but I still believe this is valuable to resource every Microsoft platform programmer interested in making sense of COM, should have on the bookself.
Comment 4 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
This book provides a good introduction to COM, and is very clearly written. It is also more carefully written than most computer books I've seen lately, with relatively few typos.
The biggest problem is that there's no CD-ROM included. The source code is supposed to be on the author's web site, along with omitted code samples that he frequently alludes to, but as of this writing, there's NOTHING on the web site. Buyer beware.
Comment 7 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse

Most Recent Customer Reviews