COM Programming with C++

5 Day Course
Hands On

Book Now - 1 Delivery Method Available:

Classroom Virtual Classroom Private Group - Virtual Self-Paced Online


Microsoft's Component Object Model (COM) has transformed Windows into an object-oriented operating system. COM specifies an object model in which developers define services in terms of interfaces. Compliant Windows objects can then interoperate via these interfaces.

COM changes the way Windows applications are structured and written, and opens up many more possibilities. This course is an essential introduction for Windows architects and analyst/programmers who need a wide appreciation of how COM enables client/server and object-oriented solutions, by giving the delegate a thorough grounding in the theory of COM, as well as examples of its use.

This course focuses on developing COM servers initially in raw C++ and then taking advantage of the Active Template Library (ATL) to simplify creation and use of COM servers. The course concludes with an introduction to Microsoft's range of Component Services in COM+.

The practical sessions build on the information given in the lectures. The sample applications that you will build during the week will show how to use the COM features presented. You will also receive additional support material, including example and demonstration software sources. Examples and practical exercises use Microsoft Visual Studio 6 under Windows 2000.

Training Partners

We work with the following best of breed training partners using our bulk buying power to bring you a wider range of dates, locations and prices.


Hide all

Component Architecture (9 topics)

  • Components and component based systems
  • Issues in code re-use
  • Separating interface from implementation
  • Interfaces and polymorphism
  • Binary encapsulation
  • Virtual function tables
  • Instance management
  • Implementing multiple interfaces
  • Resource management and reference counting

COM Fundamentals: Writing a COM Client (7 topics)

  • Using COM objects from C++
  • Using COM objects from other clients
  • GUIDs
  • Using class objects
  • Introducing IUnknown
  • Using AddRef(), Release() and QueryInterface()

COM Fundamentals: Writing a COM Server (5 topics)

  • Implementing a COM object in C++
  • Implementing IUnknown
  • Implementing a class object and IClassFactory
  • Supporting multiple interfaces
  • Registering a COM server

Introduction to IDL (9 topics)

  • Defining an interface
  • Basic keywords
  • IDL types
  • Passing parameters in and out
  • Properties
  • Interface inheritance
  • Importing definitions
  • Type libraries and the library keyword
  • Using the MIDL compiler

Exploiting The Active Template Library (ATL) (7 topics)

  • C++ Templates
  • Features and benefits
  • CComModule
  • Interface and object maps
  • Implementing IUnknown and where your class fits
  • Registry scripts
  • Using the ATL wizards in Visual C++

Automation (7 topics)

  • Automation for late binding
  • IDispatch, dispids and dispinterfaces
  • Dual interfaces
  • Automation-compatible types
  • Properties
  • ATL support for Automation

Connectable Objects (3 topics)

  • Events and callbacks
  • Connection points
  • IConnectionPoint and IConnectionPointContainer ATL support for connection points

Threads and Apartments (7 topics)

  • COM threading issues
  • Protecting global and instance data
  • Single threaded apartments
  • Multi threaded apartments
  • Marshaling requirements
  • Apartment support in ATL

Out-of-Process Servers and Distributed COM (6 topics)

  • Issues with going cross-process
  • Marshaling with proxies and stubs
  • Writing EXE Servers
  • Remoting COM Servers with DCOM
  • Configuring servers with DCOMCNFG
  • Overview of security and threading issues

Introduction to COM+ Component Services (6 topics)

  • What is COM+?
  • Transactions in COM+
  • Object pooling
  • JIT Activation
  • COM+ Loosely coupled events
  • Queued components

The Way Ahead (2 topics)

  • Attributed C++
  • COM, COM+ and interoperation with .NET


Experienced C++ programmers who wish to develop COM-based applications. Six months C++ programming and at least three months Windows programming experience is essential. Familiarity with the Microsoft Visual Studio and Microsoft Visual C++. Prior attendance of one of our Windows Programming courses is also preferred.

Course PDF


Share this Course


Recommend this Course