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

I'm using Win32::OLE to write a Perl interface to the COM objects provided by Act! (the commercial contact management database).

I have a real file, ActOle.tlb that represents the type library, but I'm not sure how to tell Win32::OLE::Const to use it.

Does the type library need to be "registered"? If so, how? (I suppose this could now be a windows question)

Here's some of my attempt:
use Win32::OLE::Const 'ActOle'; # guessing here... use Win32::OLE::Variant; use LWP::Simple qw/get/; my $Act; eval {$Act = Win32::OLE->GetActiveObject('Act!.Application')}; # guess +ing here...


Thanks for any help

-Michael

Replies are listed 'Best First'.
Re: Need Win32::OLE::Const to see my type library
by BrowserUk (Patriarch) on Nov 03, 2004 at 21:39 UTC

    As you correctly summised, this isn't a "Perl problem", but it could be done using Win32::TieRegistry or Win32::API. The information you need is available here.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
Re: Need Win32::OLE::Const to see my type library
by Nitrox (Chaplain) on Nov 03, 2004 at 23:13 UTC
    You can pull in a specific type library like so:
    use Win32::OLE::Const [ $TypeLibrary [, $VerMajor [, $VerMinor [, $Lan +guage ] ] ];
    Where $TypeLibrary is a string with the name of type library. And yes, the type library needs to be properly registered. The last three parameters are optional.

    To find the proper registered names for the Type Libraries on your system you can browse through the registry with 'regedit'. The key of interest is HKEY_CLASSES_ROOT\TypeLib. There are also numerous tools available for view type libs.

    -Nitrox