http://www.perlmonks.org?node_id=454817


in reply to Win32::OLE objects

Hi

I ran the following code:
use Win32::OLE; my $LogObj = Win32::OLE->new('LOGGERHELPER.UILogHelp'); print "REF IS: ", ref $LogObj, "\n"; print Win32::OLE->LastError(), "\n" unless ( $LogObj);
the result is:
REF IS: Win32::OLE(0.1702) error 0x800401f3: "Invalid class string"
Then I searched the registry for "LOGGERHELPER" and "LOGGERHELPER.UILogHelp". I don't have that program id in my registry, hence the OLE new method doesn't work. Do you have the .dll for that class ID registered on your machine? Where can I find it?

- j

Replies are listed 'Best First'.
Re^2: Win32::OLE objects
by anselmomh (Initiate) on May 06, 2005 at 22:29 UTC
    Thanks for all your help everyone :) 1. The zero's instead of OH's was def wrong but not causing the error i was getting.
    2. The dll is an internal app for my company so thats why you couldnt find it ;P
    3. The whole issue here is a combo of things
    Issue1: its a perlapp which is compiled into an exe so its harder to debug it seems (at least for me :P )
    Issue2: The reason it was saying an unblessed reference and quitting was because in the LINE BEFORE i called LogInit i called a function to read the logging level from the registry.. well guess what that function tried to call LogIT .. which obviously couldnt happen :(
    Again thanks everyone for all the suggestions and help i got it working now and its time for a beer :P Cya Monday!