Chapter 7: ATL COM Objects and COM Exceptions

 < Free Open Study > 



Objectives:

  • Understand ATL's support for the various threading models of COM.

  • Understand ATL's support for IUnknown.

  • Understand the various CComObject<> templates.

  • Understand the derivation of an ATL Simple Object.

  • Examine the ATL COM map.

  • Learn to throw and receive COM exceptions.

Although the previous chapter got you up and running with the ATL environment, this chapter will begin to drill down into the architecture of the ATL framework in greater detail. We begin this chapter with an overview of multithreaded programming, and quickly see how the concept of numerous paths of execution in a Win32 process can affect the COM developer. Next, we examine the options ATL provides to equip your coclasses to run within single-threaded and multithreaded apartments.

We will then examine the derivation of an ATL Simple Object and learn about the functionality supplied by CComObjectRootBase, CComObjectRootEx<>, and CComCo- Class<>. During this process, we will understand how ATL provides support for IUnknown, learn about the inner workings of the ATL COM map, and investigate the various CComObject<> templates. We wrap up this chapter by learning how a coclass can return rich error information to both C++ and Visual Basic COM clients.



 < Free Open Study > 



Developer's Workshop to COM and ATL 3.0
Developers Workshop to COM and ATL 3.0
ISBN: 1556227043
EAN: 2147483647
Year: 2000
Pages: 171

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net