COM is based on the concept of interface. An object expose a stable set of interfaces. You can navigate from one interface to another with the function QueryInterface which is part of the interface IUnknown common to all interfaces. At this level of generality COM is hardly usable for CADCAM. What makes its success is the success of the different interfaces.
DCOM COM is available across computers boundary.
Monikers
Monikers are a very general abstraction of filename and file path. Monikers can be combined into composite monikers the same way you add the directory to the filename to get the complete path. Absolute monikers are path to documents. There are at least two types of absolute monikers filename and URL. Monikers are more precise than filenames because they can identify an object within a document. To identify an item within a document you use an ItemMoniker. Hopefully you don't need to implement your own class of ItemMoniker for your documents. Item moniker rely the interface IOleItemContainer. To get sub objects within a document the interface IOleItemContainer must be available on the document.
AddRef Release: Reference count.
Reference count is the basis on the pointers management in COM. Everytime you want to keep a reference on an object through an interface you call AddRef of this interface. When you don't need it anymore you call Release. When an object have its reference count of zero it drops itself. In COM you never explicitly destroy an object. Remember that reference count are by interface not by object. Among dead lock problems there is of course the case where two objects reference themselves. Theses cases will not be handled by the reference count system.
DNA-M
Some COM Interfaces
OLEAutomation
IDispatch: A self described generic interface for all programming languages. It is the base of OLE automation. Its essential benefit is to carry together the functionality, the formal description of the interface and even the documentation on it.
OLE for Design and Manufacturing 2 COM is now used in the CADCAM area.
OLE for Process Control
COM and STEP. This is still talks and proposal but it might lead to important results for the CADCAM industry.
General (COM)
IUnknown Parent interface of all interfaces. Contain AddRef, Release and QueryInterface
IClassFactory: The way to create new objects
Document linking and embedding
| On Client Side (Container) |
IOleClientSite |
|
IAdviseSink |
| On Server Side |
IOleObject |
|
IDataObject |
Inplace Activation
ActiveX An example of application of COM on the web : ActiveX. Try the next page to experiment it. Warning. This page contain an ActiveX . It may cause trouble on some Web Browser. Don't mind if y
IDL
Interface definition language. It is a language to describe the interface and the type libraries. It looks like c++ with extra keywords between brackets [in, out] for example. When you want to now about an interface you will want to have its IDL file.
Compound storage
Compound storage is a part of OLE which support a structured storage. The file associated to your document is of special type known as a compound file. A compound file looks like a file system within a file. Within this compound file you will have to open successive sub storage four your private data. Other substorage will receive the linked and embedded objects.
More Reference (COM)
Inside OLE
The book "Inside Ole" is online, look for it in the MSDN.
COM Web Site
The Component Object Model (COM) web site at Microsoft
Software Microsoft Technology for Object Oriented development