ATL Internals

Overview

"This book is the definitive reference for ATL programmers. The chapter on CComObject is worth the price alone."--Don Box, COM guy, DevelopMentor "Brent and Chris are always technically accurate and present the information in a well written, easy to understand manner... I bought it and I'm the ATL Development Lead!"--Christian Beaumont, ATL Development Lead, Microsoft Corporation

The Active Template Library (ATL) is a set of small, efficient, and flexible classes that facilitate the creation of interoperable COM ...

See more details below
Available through our Marketplace sellers.
Other sellers (Paperback)
  • All (23) from $1.99   
  • New (4) from $11.50   
  • Used (19) from $1.99   
Close
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any BN.com coupons and promotions
$11.50
Seller since 2009

Feedback rating:

(316)

Condition:

New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

New
Brand new item. Perfect condition.

Ships from: Edmonds, WA

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$13.00
Seller since 2014

Feedback rating:

(34)

Condition: New
1999-03-31 Paperback New Fast shipment, x15Get it fast.

Ships from: austin, TX

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$45.00
Seller since 2014

Feedback rating:

(164)

Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
$45.00
Seller since 2014

Feedback rating:

(164)

Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Page 1 of 1
Showing All
Close
Sort by
Sending request ...

Overview

"This book is the definitive reference for ATL programmers. The chapter on CComObject is worth the price alone."--Don Box, COM guy, DevelopMentor "Brent and Chris are always technically accurate and present the information in a well written, easy to understand manner... I bought it and I'm the ATL Development Lead!"--Christian Beaumont, ATL Development Lead, Microsoft Corporation

The Active Template Library (ATL) is a set of small, efficient, and flexible classes that facilitate the creation of interoperable COM components. Written for experienced COM and Visual C++ programmers, this book provides in-depth coverage of ATL's inner workings. It offers insight into the rationale behind ATL design, explains its architectural underpinnings, shows how ATL maps to COM, and describes important implementation details.

With coverage current through ATL version 3.0, ATL Internals includes an overview of the Wizards but then goes well beyond the basics. The authors provide the detailed information needed to utilize ATL to its greatest advantage and work around its shortcomings. You will find detailed coverage of such topics as:

  • ATL Smart Types, such as CComPtr, CComVariant, and CComBSTR
  • Objects in ATL, covering COM object responsibilities and ATL threading model support
  • Servers in ATL, including ATL's class object implementations, managing server lifetime, self-registration, and server build optimizations
  • Interface maps, focusing on the techniques C++ programmers can use to implement COM interfaces and how ATL supports these techniques
  • Persistence and connection points
  • Enumeration, covering both pre-calculatedand dynamic data sets, and enumerating over an STL container
  • ATL windowing classes
  • Controls and Control Containment

If you want to optimize ATL by learning effective techniques that reduce the time you spend writing boilerplate COM code, there is no better resource than this book.

0201695898B04062001

Read More Show Less

Editorial Reviews

Davide Marcato
ATL Internals is definitely a book worth having (and reading) if you are serious about ATL 3.0. ... the number one resource they will continuously find themselves referring to for gaining the true mastery of every ATL-related topic and to rule out the situations not clearly addressed by the official documentation.... if you have room for only one on your desk at the office, this is the right one to always keep at hand.
Dr. Dobb's Electronic Review of Computer Books
Booknews
This guide to the active template library (ATL)<-->a set of small and flexible classes that facilitate the creation of interoperable COM components<-->is intended for experienced COM and Visual C++ programmers. It offers insight into the rationale behind ATL design, explains its architectural underpinnings, shows how ATL maps to COM, and describes implementation details. The ATL techniques provided help reduce the time spent writing boilerplate COM code. Annotation c. by Book News, Inc., Portland, Or.
Read More Show Less

Product Details

  • ISBN-13: 9780201695892
  • Publisher: Addison Wesley Professional
  • Publication date: 3/26/1999
  • Series: Object Technology Series
  • Edition description: Older Edition
  • Edition number: 1
  • Pages: 656
  • Product dimensions: 7.29 (w) x 9.14 (h) x 1.19 (d)

Meet the Author

Brent E. Rector is President of Wise Owl Consulting, Inc., a firm that specializes in Windows/COM development and consulting. He also teaches classes on COM, ATL, and MTS for DevelopMentor, a leading COM education firm. He received the Microsoft Annual MVP (Most Valuable Professional) award for his contributions to CompuServe's Windows forums.

Chris Sells is a content strategist on the Microsoft MSDN content team. Previously, he was the director of software engineering at DevelopMentor. Chris is the author of Windows Telephony Programming (Addison-Wesley, 1998) and Windows Forms Programming in Visual Basic .NET (Addison-Wesley, 2004), and coauthor of Effective COM (Addison-Wesley, 1999), ATL Internals (Addison-Wesley, 1999), and Essential .NET, Volume 1 (Addison-Wesley, 2003).



0201695898AB07302003
Read More Show Less

Read an Excerpt

PREFACE:

C is a framework for generating assembly language code (ASM). Most ASM programmers shifting to C spent a lot of time examining and replacing the compiler-generated code because they didn't trust the compiler to create correct code. As time went on and C compilers got better, ASM programmers gradually learned to trust the compiler to generate not only correct code, but also efficient code. Of course, talented C programmers never forget that the compiler is generating ASM. They know that they can still reach into selected areas and dictate the generated code when their needs exceed the capabilities of the language.

Microsoft's Active Template Library (ATL) is a framework for generating C++/COM code. Most C++ programmers shifting to ATL seem to fear examining, let alone replacing, ATL-generated code. They don't trust ATL any more than ASM programmers trusted their C compilers, because the source for ATL is fairly inscrutable to the casual observer. However, ATL is performing the same services for the C++/COM programmer that the C compiler performed for ASM programmers, namely, providing a simpler way to generate boilerplate code correctly and efficiently. Of course, talented ATL programmers never forget that ATL is generating C++/COM code. They know that they can still reach into selected areas and dictate the generated code when their needs exceed the capabilities of ATL. Our goal in writing this book is to turn you into an ATL programmer, unafraid to reach into it and bend it to your will.

This book is for the C++/COM programmer shifting to ATL 3.0, as provided with Visual C++ 6.0. Because ATL was built with a set of assumptions, to be aneffective ATL programmer you need to understand not only how ATL is built but also why. Of course, to understand the why of ATL, you'll have to understand the environment in which ATL was developed, that is, COM. Instead of attempting to compress all required COM knowledge into one or two chapters, this book assumes you already know COM and shows you the design, usage, and internals of ATL. Don Box's Essential COM (Addison-Wesley, 1998) is a good source of COM knowledge, if you'd like to brush up before diving into ATL.

With the exception of the first chapter, this book was arranged from the lowest levels of ATL to the highest, each chapter building on knowledge in previous chapters. The first chapter is a brief overview of some of the more common uses for ATL, and the wizards (if they exist) that aid in these uses. Whenever things get too detailed in the first chapter, however, we refer you to a subsequent chapter that will provide more in-depth coverage. Chapters 2 through 5 present the core of ATL. Chapter 2 covers the ATL smart types, such as CComPtr, CComQIPtr, CComBSTR, and CComVariant. Chapter 3 discusses how objects are implemented in ATL, concentrating on the great range of choices you have when implementing IUnknown. Chapter 4 discusses the glue code required to expose COM objects from COM servers. Chapter 5 delves into the implementation of IUnknown again, this time concentrating on how to implement QueryInterface, showing techniques such as tear-off interfaces and aggregation. Chapters 6, 7, and 8 discuss canned interface implementations that ATL provides to support object persistence, connection points, and COM collections and enumerators, respectively. These services can be used by components that may or may not provide their own user interface. Chapters 9, 10, and 11, on the other hand, concentrate on building both standalone applications and user interface components. These chapters cover the ATL window classes, controls, and control containment, respectively. Because much of what makes the ATL source difficult to read is its advanced use of templates, Appendix A provides a set of examples meant to illustrate how templates are used and built. If you've seen ATL source code before and wondered why you can pass the name of a deriving class to a base class template, you may find Appendix A useful. Appendix B provides a list of the important ATL classes and the header files in which they are declared (and often implemented).

When writing these chapters, it became necessary not only to show diagrams and sample usage code, but also internal ATL implementation code. In fact, this book often becomes your personal tour guide through the ATL source code.

Because the ATL team didn't write their code to be published in book form, it was often necessary to reformat it or even to abbreviate it. Every effort has been made to retain the essence of the original code, but, as always, the ATL source code is the final arbiter. You might find Appendix B useful when tracking down the actual implementation.

If there are any errors in the sample source or in any part of this book, you may contact Brent Rector at ...

Read More Show Less

Table of Contents

Foreword
Preface
Ch. 1 Hello, ATL 1
Ch. 2 ATL Smart Types: Strings, BSTRs, VARIANTs, and Interface Pointers 33
Ch. 3 Objects in ATL 93
Ch. 4 COM Servers 157
Ch. 5 Interface Maps 211
Ch. 6 Persistence in ATL 257
Ch. 7 Collections and Enumerators 299
Ch. 8 Connection Points 357
Ch. 9 Windowing 407
Ch. 10 ActiveX Controls 475
Ch. 11 Control Containment 539
App. A C++ Templates by Example 601
App. B ATL Classes and Headers 615
Index 623
Read More Show Less

Preface

C is a framework for generating assembly language code (ASM). Most ASM programmers shifting to C spent a lot of time examining and replacing the compiler-generated code because they didn't trust the compiler to create correct code. As time went on and C compilers got better, ASM programmers gradually learned to trust the compiler to generate not only correct code, but also efficient code. Of course, talented C programmers never forget that the compiler is generating ASM. They know that they can still reach into selected areas and dictate the generated code when their needs exceed the capabilities of the language.

Microsoft's Active Template Library (ATL) is a framework for generating C++/COM code. Most C++ programmers shifting to ATL seem to fear examining, let alone replacing, ATL-generated code. They don't trust ATL any more than ASM programmers trusted their C compilers, because the source for ATL is fairly inscrutable to the casual observer. However, ATL is performing the same services for the C++/COM programmer that the C compiler performed for ASM programmers, namely, providing a simpler way to generate boilerplate code correctly and efficiently. Of course, talented ATL programmers never forget that ATL is generating C++/COM code. They know that they can still reach into selected areas and dictate the generated code when their needs exceed the capabilities of ATL. Our goal in writing this book is to turn you into an ATL programmer, unafraid to reach into it and bend it to your will.

This book is for the C++/COM programmer shifting to ATL 3.0, as provided with Visual C++ 6.0. Because ATL was built with a set of assumptions, to be an effective ATLprogrammer you need to understand not only how ATL is built but also why. Of course, to understand the why of ATL, you'll have to understand the environment in which ATL was developed, that is, COM. Instead of attempting to compress all required COM knowledge into one or two chapters, this book assumes you already know COM and shows you the design, usage, and internals of ATL. Don Box's Essential COM (Addison-Wesley, 1998) is a good source of COM knowledge, if you'd like to brush up before diving into ATL.

With the exception of the first chapter, this book was arranged from the lowest levels of ATL to the highest, each chapter building on knowledge in previous chapters. The first chapter is a brief overview of some of the more common uses for ATL, and the wizards (if they exist) that aid in these uses. Whenever things get too detailed in the first chapter, however, we refer you to a subsequent chapter that will provide more in-depth coverage. Chapters 2 through 5 present the core of ATL. Chapter 2 covers the ATL smart types, such as CComPtr, CComQIPtr, CComBSTR, and CComVariant. Chapter 3 discusses how objects are implemented in ATL, concentrating on the great range of choices you have when implementing IUnknown. Chapter 4 discusses the glue code required to expose COM objects from COM servers. Chapter 5 delves into the implementation of IUnknown again, this time concentrating on how to implement QueryInterface, showing techniques such as tear-off interfaces and aggregation. Chapters 6, 7, and 8 discuss canned interface implementations that ATL provides to support object persistence, connection points, and COM collections and enumerators, respectively. These services can be used by components that may or may not provide their own user interface. Chapters 9, 10, and 11, on the other hand, concentrate on building both standalone applications and user interface components. These chapters cover the ATL window classes, controls, and control containment, respectively. Because much of what makes the ATL source difficult to read is its advanced use of templates, Appendix A provides a set of examples meant to illustrate how templates are used and built. If you've seen ATL source code before and wondered why you can pass the name of a deriving class to a base class template, you may find Appendix A useful. Appendix B provides a list of the important ATL classes and the header files in which they are declared (and often implemented).

When writing these chapters, it became necessary not only to show diagrams and sample usage code, but also internal ATL implementation code. In fact, this book often becomes your personal tour guide through the ATL source code.

Because the ATL team didn't write their code to be published in book form, it was often necessary to reformat it or even to abbreviate it. Every effort has been made to retain the essence of the original code, but, as always, the ATL source code is the final arbiter. You might find Appendix B useful when tracking down the actual implementation.

If there are any errors in the sample source or in any part of this book, you may contact Brent Rector at http://www.wiseowl.com and Chris Sells at http://www.sellsbrothers.com. The source code used in this book is available at http://www.wiseowl.com/ATLInternals.htm.

The authors would like to thank all of the following for their contributions to this book. While it may have been possible to complete this book without them, it would have been a pale imitation of what we were able to achieve with their help. Chris would like to thank his wife, Melissa, and his boys, John and Tom, for sparing him the countless evenings and weekends to work on this project. Chris would also like to thank Brent Rector for letting him horn in on his book project.

Brent would like to thank his wife, Lisa, and his children, Carly and Sean, for delaying the delivery of this book significantly. If it weren't for them, he'd never leave the computer some days. Brent would like to thank Chris for his intelligence, patience, and general good looks.(1)

Brent and Chris would like to thank several folks together. Special thanks to Christian Beaumont, Jim Springfield, Walter Sullivan, and Mark Kramer for suffering our nagging questions and taking the time to answer them. More special thanks to Don Box for his MSJ ATL feature, which so heavily influenced the course and, in turn, this book. Thanks to the reviewers: Don Box, Keith Brown, Jon Flanders, Mike Francis, Kevin Jones, Stanley Lippman, Dharma Shukla, Jim Springfield, Jeff Stalls, Jaganathan Thangavelu, and Jason Whittington. Special thanks goes to Dharma for his especially thorough, and educational, reviews. Thanks to fellow DevelopMentor instructor Fritz Onion for his groundbreaking work delving into the depths of ATL control containment. Thanks to a former student, Valdan Vidakovic, for inspiring Chris to delve a bit more into the HTML control. Thanks to Tim Ewald, Jim Springfield, and Don Box for their help in developing the forwarding shims trick. Thanks to the members of the ATL and DCOM mailing lists, especially Don Box, Tim Ewald, Charlie Kindel, Valery Pryamikov, Mark Ryland, and Zane Thomas. And last, but not least, thanks to Addison-Wesley, especially J. Carter Shanklin and Krysia Bebick, for providing an environment in which we actually want to write (although not as quickly or as concisely as they might like).

(1) You only get one guess as to who wrote this sentence, and he doesn't have my initials or my good looks. BER



Read More Show Less

Introduction

C is a framework for generating assembly language code (ASM). Most ASM programmers shifting to C spent a lot of time examining and replacing the compiler-generated code because they didn't trust the compiler to create correct code. As time went on and C compilers got better, ASM programmers gradually learned to trust the compiler to generate not only correct code, but also efficient code. Of course, talented C programmers never forget that the compiler is generating ASM. They know that they can still reach into selected areas and dictate the generated code when their needs exceed the capabilities of the language.

Microsoft's Active Template Library (ATL) is a framework for generating C++/COM code. Most C++ programmers shifting to ATL seem to fear examining, let alone replacing, ATL-generated code. They don't trust ATL any more than ASM programmers trusted their C compilers, because the source for ATL is fairly inscrutable to the casual observer. However, ATL is performing the same services for the C++/COM programmer that the C compiler performed for ASM programmers, namely, providing a simpler way to generate boilerplate code correctly and efficiently. Of course, talented ATL programmers never forget that ATL is generating C++/COM code. They know that they can still reach into selected areas and dictate the generated code when their needs exceed the capabilities of ATL. Our goal in writing this book is to turn you into an ATL programmer, unafraid to reach into it and bend it to your will.

This book is for the C++/COM programmer shifting to ATL 3.0, as provided with Visual C++ 6.0. Because ATL was built with a set of assumptions, to be an effective ATLprogrammer you need to understand not only how ATL is built but also why. Of course, to understand the why of ATL, you'll have to understand the environment in which ATL was developed, that is, COM. Instead of attempting to compress all required COM knowledge into one or two chapters, this book assumes you already know COM and shows you the design, usage, and internals of ATL. Don Box's Essential COM (Addison-Wesley, 1998) is a good source of COM knowledge, if you'd like to brush up before diving into ATL.

With the exception of the first chapter, this book was arranged from the lowest levels of ATL to the highest, each chapter building on knowledge in previous chapters. The first chapter is a brief overview of some of the more common uses for ATL, and the wizards (if they exist) that aid in these uses. Whenever things get too detailed in the first chapter, however, we refer you to a subsequent chapter that will provide more in-depth coverage. Chapters 2 through 5 present the core of ATL. Chapter 2 covers the ATL smart types, such as CComPtr, CComQIPtr, CComBSTR, and CComVariant. Chapter 3 discusses how objects are implemented in ATL, concentrating on the great range of choices you have when implementing IUnknown. Chapter 4 discusses the glue code required to expose COM objects from COM servers. Chapter 5 delves into the implementation of IUnknown again, this time concentrating on how to implement QueryInterface, showing techniques such as tear-off interfaces and aggregation. Chapters 6, 7, and 8 discuss canned interface implementations that ATL provides to support object persistence, connection points, and COM collections and enumerators, respectively. These services can be used by components that may or may not provide their own user interface. Chapters 9, 10, and 11, on the other hand, concentrate on building both standalone applications and user interface components. These chapters cover the ATL window classes, controls, and control containment, respectively. Because much of what makes the ATL source difficult to read is its advanced use of templates, Appendix A provides a set of examples meant to illustrate how templates are used and built. If you've seen ATL source code before and wondered why you can pass the name of a deriving class to a base class template, you may find Appendix A useful. Appendix B provides a list of the important ATL classes and the header files in which they are declared (and often implemented).

When writing these chapters, it became necessary not only to show diagrams and sample usage code, but also internal ATL implementation code. In fact, this book often becomes your personal tour guide through the ATL source code.

Because the ATL team didn't write their code to be published in book form, it was often necessary to reformat it or even to abbreviate it. Every effort has been made to retain the essence of the original code, but, as always, the ATL source code is the final arbiter. You might find Appendix B useful when tracking down the actual implementation.

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)