COM Programming Fundamentals Using ATL Course

Course Code: CS 26
Course Abstract: This 3 day course covers the fundamental principles of COM programming for the C++ programmer. The basic concepts of COM are covered, beginning with the programming of COM clients. This knowledge is essential for modern Windows programming using C++, because so many important Microsoft interfaces are now exposed through COM. The fundamental concepts of COM servers are then presented. ATL is introduced as an effective technology for implementing COM servers in C++, beginning with in-process (DLL) servers. The COM remoting architecture is covered, including a discussion of proxies and stubs and the implementation of EXE servers. The apartment concept is introduced. Surrogates are discussed, and interception is introduced. COM data types are covered, including use of ATL support classes. Memory management and the use of IDL is covered. Error processing and debugging are discussed, a topic of vital importance in complex distributed environments. Additional features of the COM programming model required for Visual Basic programming are covered, including coclasses, default interfaces and type libraries. Automation is introduced as a technology enabling COM to work with scripting environments. An appendix covers the Visual C++ compiler support for COM clients, including smart pointers and the import directive for a type library. The course includes extensive programming examples and lab exercises.
Audience: This course is designed for programmers.
Duration: 3 days
Learning Outcomes: Upon completion of this course, the participant will be able to:
> Acquire a basic understanding of the core concepts of COM
> Learn how to program COM clients using C++ and Visual Basic
> Learn how to program COM servers using C++ and the Active Template Library
Course Topics:

COM/COM+ Clients: Concepts and Programming 
Clients for COM and COM+ Servers
Interfaces
Classes and Objects
Globally Unique Identifiers
Servers
Registration
Instantiating an Object
Object Lifetime and Interface Negotiation
Initializing COM
COM Client Programming Model
Visual C++ Console Client
GUI Client Using MFC 

Understanding COM Servers 
Libraries
Servers
Location Transparency
COM Runtime Architecture
Registry
Class Factories
Loading and Unloading
Dynamic Link Libraries
Structure of an In-Process Server           

Implementing In-Process Servers Using ATL 
The ATL Abstraction
ATL COM AppWizard
ATL Object Wizard
Specifying Interfaces Using IDL
ATL Class Factory Support
ATL Registration Support
Multiple Interfaces 

EXE Servers and Surrogates 
EXE Servers
Proxies and Stubs
MIDL Compiler
Surrogates
Apartments and Threads
Interception 

COM Data Types and ATL Support Classes 
Strings in COM
Conversion Macros
Memory Management and IDL
BSTR and CComBSTR
Smart Pointers
VARIANT and CComVariant 

Error Processing and Debugging 
Error and Facility Codes
COM Error Interfaces
Tracing
A Logger Component
Breaking Into Server Code 

Programming COM Clients Using Visual Basic           
Coclasses
Type Libraries
Default Interface
Accessing Other Interfaces
Releasing an Interface
Visual Basic COM Client 

Automation and Scripting 
Early and Late Binding
IDispatch
VARIANT
Dual Interfaces
Thin Clients and VBScript
Enumerators
Collections and Object Models 

Visual C++ COM Support 
Using Type Libraries with Import Directive
Namespaces
Smart Pointers
Error Handling
bstr_t

Prerequisites: Experience with Windows programming using Visual C++ and a basic understanding of Win32 architecture. Attendees should also be literate in Visual Basic, so that they can create simple form-based GUI client test programs.
Note: All fields are required
At the present time we do not offer training for individuals or groups less then 6 individuals. We apologize for any inconvenience.


We Value Your Privacy!

Ready to get started or in need of more information? Contact us today.

Go To Blog Virtual Learning