Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

OLE/COM Object Viewer (oleview.exe) [with tutorial]

  • Please log in to reply
No replies to this topic
  • Members
  • 571 posts
  • Last active: Aug 01 2015 03:45 PM
  • Joined: 15 Sep 2006
OLE/COM Object Viewer (oleview.exe)

Browses, configures, and tests Microsoft Component Object Model classes installed on a computer.

The "OLE/COM Object Viewer" is a very handy tool to get a peek on all COM objects currently installed on your system. It is part of the Windows 2000 resource kit and can be downloaded for free from here

An exe called oleview.exe is installed by default in "C:\Program Files\Resource Kit". It is missing a file called IViewers.dll. I am attaching the dll with this post. Copy it to the same directory where oleview.exe resides and register the dll using the command line: regsvr32 iviewers.dll.

Download: OLE/COM Object Viewer | IViewers.dll

Menu -> View -> Expert mode (clear expert mode)
Run it and follow this tree: Control->Microsoft Web Browser.

Posted Image

The right pane contains a lot of information to use this object in an AHK script. "VersionIndependentProgID" contains the name to be used in an ComObjCreate function. InProcServer32 means that the object runs in the same thread as our script (in-process). When you see LocalServer32, the object runs as a separate process. The object must also contain a type library (the lines following "TypeLib="), otherwise (afaiu) it can't be used in an AHK script.

The interfaces in the left column are several ways of interacting with the object. IOleObject, IOleControl are used for embedding in a GUI. AHK uses the IDispatch interface for automation. This interface exposes all scriptable methods and properties that the object supports.

Right-click -> "View..." -> "View TypeInfo..." (button is grayed out if you have not registered the IViewers.dll, or the object does not have a type library)

Posted Image

The methods and properties are shown. Browse through the "Inherited Interfaces" to retrieve more methods for the object.

The syntax of the described methods/properties are in C/C++ style. A property described as "HRESULT Resizable([in] VARIANT_BOOL pbOffline)" can be used in AHK like: Resizable := Obj.Resizable

- Adapted for AHK from another web-tutorial. Maybe someone with more insight into COM/OLE can expand on this.