Saturday, January 30, 2010

Using OLEView to Explore the QuickTime COM Interface

I'm currently working on some automation for my timelapse video project. As part of that effort I needed to explore the Windows scripting interface to QuickTime.  Here is a quick look at one of the tools I learned.

The QuickTime COM interface is poorly documented, but Rousseau mentioned the cool trick of using MicroSoft's OLEView tool to explore.  I had never used it before, so here is a quick walk-through.
  • Download oleview.exe if you don't already have it (see References section).
  • Open a command shell and run oleview.exe. It opens a window titled "OLE/COM Object Viewer".
  • Open the "Type Libraries" tab (it's near the bottom).  You'll be interested in everything that starts with "Apple QuickTime" as well as "QtMovExporter".
  • For example, double-click on "Apple QuickTime Player Library 1.0" to open the IDL viewer.  Look in the IDL panel and find the declaration "library QuickTimePlayerLib".  Now realize that this library is what a script refers to in a line such as  "WScript.CreateObject("QuickTimePlayerLib.QuickTimePlayerApp")".
  • Expand the "dispinterface" tabs for IQuickTimePlayerApp, IQuickTimePlayers, and IQuickTimePlayer.  Compare the listed methods with the ones used in our script.
  • Notice that the IQuickTimePlayer.QTControl method returns an "IQTControl" object.  It's not defined in QuickTimePlayerLib.  Close the IDL viewer window and return to the main OLE view window.  Double-click "Apple QuickTime Control 2.0" to view its interface and observe that it defines IQTControl.
This is a great way of checking the interface of any COM object.


I have lots more QuickTime references that will appear in an upcoming post about the automation itself.

1 comment:

Chip Chapin (H) said...

I have just converted the script to Python and will be posting it soon.