S
Simon Lockhart
Apologies if this is the wrong place to ask, but if so would appreciate
pointers in the right direction.
I'm trying to manage some Windows Media encoders remotely, using Perl and
Win32::OLE. I've translated some example VB code from the MSDN website, and
ended up with the following:
----------------8<-----------------------------------
#! c:\perl\bin\perl.exe
use strict;
use Win32::OLE;
use Data:
umper;
my $encagent = Win32::OLE->new(["boc1enc01", "WMEncAgt.WMEncoderAgent"]);
my $encoder = $encagent->GetEncoder($encagent->EncoderNamesCollection->item(0));
my $type = Win32::OLE->QueryObjectType($encoder);
print "Its a ", Dumper($type);
print $encoder,"\n";
my $Count = Win32::OLE->EnumAllObjects(sub {
my $Object = shift;
my $Class = Win32::OLE->QueryObjectType($Object);
printf "# Object=%s Class=%s\n", $Object, $Class;
})
----------------8<-----------------------------------
Now, from my understanding of the MSDN docs, $encoder should be of type
IWMEncoder, but QueryObjectType returns undef for it. Is this a bug or
feature? Is there any way to "cast" the object to an IWMEncoder?
Thanks,
Simon
pointers in the right direction.
I'm trying to manage some Windows Media encoders remotely, using Perl and
Win32::OLE. I've translated some example VB code from the MSDN website, and
ended up with the following:
----------------8<-----------------------------------
#! c:\perl\bin\perl.exe
use strict;
use Win32::OLE;
use Data:
my $encagent = Win32::OLE->new(["boc1enc01", "WMEncAgt.WMEncoderAgent"]);
my $encoder = $encagent->GetEncoder($encagent->EncoderNamesCollection->item(0));
my $type = Win32::OLE->QueryObjectType($encoder);
print "Its a ", Dumper($type);
print $encoder,"\n";
my $Count = Win32::OLE->EnumAllObjects(sub {
my $Object = shift;
my $Class = Win32::OLE->QueryObjectType($Object);
printf "# Object=%s Class=%s\n", $Object, $Class;
})
----------------8<-----------------------------------
Now, from my understanding of the MSDN docs, $encoder should be of type
IWMEncoder, but QueryObjectType returns undef for it. Is this a bug or
feature? Is there any way to "cast" the object to an IWMEncoder?
Thanks,
Simon