COM Programming  «Prev  Next»
Lesson 5 Course project
Objective Describe the course project.

Course Project Description

COM Fundamentals Course Project

In COM Fundamentals II(Advanced COM), you will develop two new COM objects:
  1. Memo in server InfoMgr and
  2. MemoAgg in server InfoMgrAgg.
Memo reuses PhBookObj (from the PhBook project in COM Fundamentals I) through containment/delegation. MemoAgg reuses PhBookObj via aggregation. You will also develop a client named InfoMgrCli that uses both Memo and MemoAgg.
COM Fundamentals II builds on the project you developed in Basic COM (COM Fundamentals I). If you do not have that project, do not worry. It is available from the Resources page. You will receive instructions on how to download and install the appropriate files when you need them.

Project versions

For modern applications using Microsoft C++, you should use the lastest version of Visual Studio available from Microsoft, which can be downloaded using the following link.
Download Latest Visual Studio Compiler You should download only the one that corresponds to the version you will be using when taking the course.
COM Fundamentals II was written for the Visual C++ 6 which was more than 20 years ago. The code should still run using the Microsoft Visual Studio 2019 C++ Compiler. Differences between procedures for the two versions are noted in the instructions. Differences between the C++ compilers is commented in the code provided in the lessons and exercises.

Microsoft’s Component Object Model

Microsoft’s Component Object Model was devised to facilitate the reuse of software artifacts at the post-compilation level or at the binary level. The system utilizes interfaces and components (i.e., subroutines and structures designed in a certain way), an identification scheme for software artifacts and interfaces, and system calls. For a user of the computational service provided by this reuse system, a component is the unit of reuse. The client of a service makes a system call requesting the operating system to instantiate an object of a component.
A component has a set of interfaces. There is an interface that must be implemented by each component, called interface IUnknown. This interface has three methods: QueryInterface, Add, and Release. QueryInterface handles a client’s request to a component for an interface. Add and Release keep track of the number of current clients for the components in the system. Every component and interface has a 128-bit identification number. A client passes a component identification number when it requests the system to instantiate an object of the component. Having the pointer to a component object, the client should pass an interface identification number when requesting an interface from the component object.