OLE/COM Object Viewer Main Topic

OLE/COM Object Viewer Interface Viewers

In OleView, interface viewers are Component Object Model (COM) objects. Viewers for IDataObject (Uniform Data Transfer), IDispatch, IPersistXXX, ITypeLib and ITypeInfo are provided. There is a default interface viewer for IUnknown, so that no matter what interface you click you'll get at least the default (taking advantage of the default class capabilities of Component Categories).

The ITypeLib viewer is a type library decompiler, so that output window of the viewer shows the .odl source for the given type library (or the part you have selected).

OLE/COM Object Viewer supports plug-in interface viewers. If you have designed a COM interface, or would like to be able to use some existing interface, you can develop your own interface viewers (see the IDL file for the IInterfaceViewer interface below). Simply create an in-process COM server which implements the IInterfaceViewer interface and have it register the following information:

HKCR\Interface\{the IID you want to view}\OleViewerIViewerCLSID = {your clsid}

You should also use the Component Category Manager to register your viewer's CLSID as implementing the OLEViewer Interface Viewer CATID: {64454F82-F827-11CE-9059-080036F12502}.

IDL for IInterfaceViewer

// iview.idl
//
// Interface definitions for Ole2View Interface Viewers
//
import "unknwn.idl";

// DEFINE_GUID(IID_IInterfaceViewer,0xfc37e5ba,0x4a8e,0x11ce, 0x87,0x0b,0x08,0x00,0x36,0x8d,0x23,0x02);
//
// IInterfaceViewer::View can return the following SCODEs
//
// S_OK
// E_INVALIDARG 
// E_UNEXPECTED
// E_OUTOFMEMORY        
// 
[
    uuid(fc37e5ba-4a8e-11ce-870b-0800368d2302),
    object
]
interface IInterfaceViewer : IUnknown
{
    HRESULT View([in]HWND hwndParent, [in]REFIID riid, [in]IUnknown* punk);
}