Jobby has asked for the wisdom of the Perl Monks concerning the following question:

I've found an object using the OLE Browser included with the ActiveState distribution that I wish to use in a Perl script. The object name is 'Microsoft Telephony', the library name is 'TELLib' and the class I want to use is called 'phone'. However, $ex = Win32::OLE->new('TELLib.phone');, $ex = Win32::OLE->new('TELLib'); and $ex = Win32::OLE->new('Microsoft Telephony'); all fail with Win32::OLE(0.1403) error 0x800401f3: "Invalid class string". Can anyone help?

Replies are listed 'Best First'.
Re: Problem Accessing Object using Win32::OLE
by larryk (Friar) on Aug 14, 2002 at 15:23 UTC
    The following works on my Win2k box:
    #!perl use strict; use warnings; use Data::Dumper; use Win32::OLE; my $phone = Win32::OLE->new('{FC9E740F-6058-11D1-8C66-0060081841DE}'); + # don't ask! print Dumper($phone);
    but I had to rake the registry for 'Telephony' (the string you should search for if you want to find it yourself is 'Telephony Class') to get it out of \HKEY_CLASSES_ROOT\CLSID

    Hope this helps

       larryk                                          
    perl -le "s,,reverse killer,e,y,rifle,lycra,,print"