OLE Background: MFC Implementation
| Overview | How Do I | Sample | Tutorial
Because of the size and complexity of the raw OLE API, calling it directly to write OLE applications can be very time-consuming. The goal of the Microsoft Foundation Class Library implementation of OLE is to reduce the amount of work you have to do to write full-featured, OLE-capable applications.
This article explains the parts of the OLE API that have not been implemented inside MFC. The discussion also explains how what is implemented maps to the OLE section of the Win32 SDK.
Portions of OLE Not Implemented by the Class Library
There are a few interfaces and features of OLE not directly provided by MFC. If you want to use these features, you can call the OLE API directly.
IMoniker Interface
The IMoniker interface is implemented by the class library (for example, the COleServerItem class), but has not previously been exposed to the programmer. For more information about this interface, see OLE Moniker Implementations in the OLE section of the Win32 SDK. However, see also class and .
IUnknown and IMarshal Interfaces
The IUnknown interface is implemented by the class library, but is not exposed to the programmer. The IMarshal interface is not implemented by the class library, but is used internally. Automation servers built using the class library already have marshalling capabilities built in. For more information about these interfaces, see the OLE Programmer’s Reference.
Docfiles (Compound Files)
Compound files are partially supported by the class library. None of the functions that directly manipulate compound files beyond creation are supported. MFC uses class COleFileStream to support manipulation of streams with standard file functions. For more information, see the article Containers: Compound Files.
In-Process Servers and Object Handlers
In-process servers and object handlers allow implementation of visual editing data or full component object model (COM) objects in a DLL. To do this, you can implement your DLL by calling the OLE API directly. However, if you are writing an Automation server and your server has no user interface, you can use AppWizard to make your server an in-process server and put it completely into a DLL. For more information about these topics, see the article Automation Servers and also The OLE Messaging Library: An Automation Server in the Win32 SDK.
Tip The easiest way to implement an Automation server is to place it in a DLL. MFC supports this approach.
For detailed information on how the Microsoft Foundation OLE classes implement OLE interfaces, see MFC Technical Notes , , and .