Vista


I have been using the Windows Media Center Edition (MCE) for several years and have had great success with it. My home built Home Theater PC (HTPC) was beefy and decked out (for the time). All in all it was nice. Then came our plasma HDTV which changed everything. I had to upgrade from 2 internal video capture cards to use 2 Comcast HD set top boxes. But to get HD out of it I had to use 1394, bubble gum and baling wire. It was as hacky as it got, but it worked — usually.

Several years later I finally broke down and purchased a Vista MCE. It’s a very nice Velocity Micro box and decked out with 2 internal cablecard tuners and a beefy video card. Again, it is very nice. Very nice, until I tried using my XBox 360 as a Media Extender.Long ago I purchased a Linksys media center extender so that I could watch news, movies and, of course, Law & Order while on the elliptical machine. The problem was that once we started recording HD I was screwed. The Linksys not only could not handle the bandwidth required for HD over its wireless network, but the machine itself couldn’t handle it even if it was wired directly with a cat 5 cable. Sad, very, very sad.

Today I was debugging a problem with a script I was writing when I stumbled upon an interesting problem. The script takes data from my clipboard, processes it, formats an HTML report then creates an Outlook email message which it inserts the formatted report and sends it out to a list of recipients.

The script did everything that it should but ran into a problem when it called into the Outlook object model using COM. The standard way to instantiate a COM object is to first attempt to connect with Outlook if it is already running, otherwise run Outlook specifically for the sake of the script:

use Win32::OLE;
my $Class = "Outlook.Application";
my $Outlook = Win32::OLE->GetActiveObject( $Class ) || new Win32::OLE( $Class );
die if ! defined( $Outlook );

This is exactly where my script was failing. The calls into Win32::OLE would pause for several seconds but always return undef. How odd. Calling into Win32::OLE->LastError() to determine the error yielded an equally confusing error message:

0x80080005: "Server execution failed"

Of course there was no easy way to learn why the COM server execution had failed. Needless to say, after tinkering around a bit I discovered that if I first quit Outlook the script executed perfectly. It was only if I was running Outlook that the script failed. How odd.