Web Resources:
Linux Tutorials eclipse Code Project SysInternals Best SysInternals Tools Dr. Dobb's Journal Windows Forms COM at MSDN IDL Language base MIDL types OLE data types IDL attributes MIDL data types MIDL Language ReferenceContent:
In this lecture we discuss COM Apartments.- Syllabus describes topics to be covered, reading material for you to digest before coming to class, and due dates for the assigned projects.
-
Project #1, Project1HelpS19
-
Project #1 Prototype
This demo has a client, a using component, and a used component. The client creates both used and using components, then passes a pointer to used to the using to set up that communication. This structure would work fine for Project #1, where the used component is FileMgr and the using component is the TextSearch component.This was supposed to be a simple demonstration of how to use the ATL wizards. Unfortunately they are broken in Visual Studio 2017. To do the demonstration, I installed VS 2015 to carry out the demo. I then loaded that project into Visual Studio 2017 to execute and demonstrate the communication patterns between client, used, and using components. -
You will find in the CSE775/Code/Project1HelpS19, a demonstration of
FileSystem, a package of file, path, and directory operations implemented with classes:
- Block and File
- FileInfo
- Path
- Directory
-
Thread Locking Performance
Testing C++11 synchronization performance
How does C++11 synchronization performance compare to Win32 synchronization? - Technology Presentations
- Building COM Projects
-
Connection Points:
Connectable Objects
Introduction to Connection Points.
ATLProject1_Helper
Demonstrates building a simple component with connection point callbacks and both C++ and C# clients.Late Binding, ppt Late Binding COM Events, ppt -
Out-of-Process COM Components
OutProc PresentationOutProc Class Diagram, OutProc Sequence Diagram
OutProc ST Structure Chart, OutProc MT Structure ChartIDL Demo - Interfac
We looked at this before. It's here as a reminder that all the interface method parameters were being marshalled between the client and component processes.Raw C++ Out-of-Process Single-Threaded Apartment Component
We will go through this code carefully so you see the structure of an out-of-proc COM component.Raw C++ Out-of-Process Multi-Threaded Apartment Component
We will make a quick comparison of this with the previous code so you see the differences between ST and MT code.ATL Out-of-Process Single-Threaded Apartment Component
This is the ATL-based version of the OutProcST project.OutProc with console
Out-of-Process components have no visible interface unless you add one. This demonstrates how to add a console.OutProc with dialog
Out-of-Process components have no visible interface unless you add one. This demonstrates how to add a dialog. -
COM Apartments
COM overview - Review - MSDNProcesses, Threads, and Apartments - MSDN COM Apartments Presentation Thread Rules Understanding COM Apartments, Part I - Jeff Prosise, Understanding COM Apartments, Part II - Jeff Prosise Eight Lessons from the COM school of Hard Knocks Marshaling Interface Pointers between Client Threads
You can't pass interface pointers between apartments witout marshaling. To do so breaks the COM threading model. This project shows you how to do that marshaling.Component calls component
This project demonstrates how to marshal an interface pointer through a COM interface. Look at the IDL for the OutterComp. You will see it pass an interface pointer to the InnerComp back to the client. The inner component is created by the outter component, but at the end the client needs to access the inner component to get its state information, so the client just uses the returned (marshaled) interface pointer for that. -
Distributed COM: and COM+
-
Other COM Topics:
Windows Template Library (WTL)
Thin windows library created by ATL team.Structured Storage
Demonstration of Structured Storage, e.g., file system in a file.Speech API
Quick demo of Speech API - built with COM.Accessing Registry
Programming the Registry (no guarantee it's bug free - buyer beware)Monikers
Monikers are COM links between other COM objects and files, etc.Marshaling COM Pointers in Stream
Demonstrates marshaling a COM pointer between Apartments using streams.COM Persistance
Quick demo of COM persistance.Automation with IDispatch
Demonstates use of Automation with a raw C++ IDispatch implementation.Demo ActiveX Control
Demonstrates a simple composite ActiveX Control running in a web page. -
JavaScript and Go
-
RESTful Web Services