COM Programming with C++

מק"ט: #4390 | משך קורס: 40 שעות אק'

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.

הקורס פעיל לקבוצות מטעם ארגונים בלבד, ניתן לשלוח פנייה רק אם מדובר בקבוצה
*שדות חובה



  • Understand why COM is needed
  • List the main features of the Component Object Model (COM)
  • Implement a COM server and client
  • Use ATL to simplify COM development
  • Generate and handle events with connectable objects
  • Understand the issues with distributing COM functionality
  • Describe the core facilities of COM+


קהל יעד

Experienced C++ programmers who wish to develop COM-based applications.

תנאי קדם

Familiarity with the Microsoft Visual Studio and Microsoft Visual C++.  Prior attendance of one of our Windows Programming courses is also preferred.


Component Architecture

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

Using COM objects from C++; Using COM objects from other clients; GUIDs; HRESULTs; Using class objects; Introducing IUnknown; Using AddRef, Release and Query Interface

COM Fundamentals: Writing a COM Server

Implementing a COM object in C++; Implementing IUnknown; Implementing a class object and IClassFactory; supporting multiple interfaces; Registering a COM server

Introduction to IDL

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)

C++ Templates; Features and benefits; CCom Module; Interface and object maps; Implementing IUn known and where your class fits; Registry scripts; Using the ATL wizards in Visual C++


Automation for late binding; IDispatch, dispids and dispinterfaces; Dual interfaces; Automation-compatible types; Variants, BSTRs and SAFE Arrays; Properties; ATL support for Automation

Connectable Objects

Events and callbacks; Connection points; IConnection Point and IConnection Point Container; ATL support for connection points

Threads and Apartments

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

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

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

The Way Ahead

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