Here is a snippit based on the example in the ActivePerl User Guide with iTunes 
instead of Excel..

# use existing instance if iTunes is already running
eval {$iTunesHandle = Win32::OLE->GetActiveObject('iTunes.Application')};
die "iTunes not installed" if $@;
unless (defined $iTunesHandle) {
  $iTunesHandle = Win32::OLE->new('iTunes.Application', sub {$_[0]->Quit;})
     or die "Oops, cannot start iTunes";
}

A running instance of iTunes will always be killed, because 
Win32::OLE->GetActiveObject never finds an object! I tried a generic CLSID, and 
specific PROGID version strings, but nothing makes GetACtiveObject return an 
object. I used OLEView to check on the CLSID of iTunes.. you can see it is just 
a fairly straightforward interface.

I think this is a problem with RPC, SP2 and new security patches. I had some 
other trouble with RPC recently for an install program for a USB DSL modem.. it 
died at the end with an RPC call failed message. No one seemed to know what I 
was talking about (happened 2 days ago), but I'm certain my computer is ok. I 
was going to use Safe Mode boot to play with the permissions, but I can't 
afford the time to reinstall windows if something goes wrong.

Any other applications that can't use GetActiveObject through a typelib 
interface? Is there a work around for this? Is it just my problem?

Richard


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to