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

I am trying to control a Matlab COM server object from perl but am running into some problems. When I try to create the server object using the following code:
$matlab = Win32::OLE->new('Matlab.Application') or die "Oops\n";
I get the error message: Win32::OLE(0.1008) error 0x80040111: "ClassFactory cannot supply requested class" Now the interesting thing is that if I try to launch Word I can create the COM object successfully. Also, I am pretty sure that when I tried a week ago I was able to also create the matlab COM server object successfully at least once. In OLE/COM Object Viewer I also get a similar error when I try to create an instance of matlab: CoGetClassObject failed. I tried reinstalling matlab multiple time to no avail. I looked at the registry entries and it seems like the registry keys that would be required to locate the matlab server are all there. What makes is stranger is that I was just able to create a matlab server object from C++ code. Any help would be greatly appreciated. Rich

Replies are listed 'Best First'.
Re: Strange OLE ClassFactory cannnot supply requested class error
by doowah2004 (Monk) on Aug 31, 2004 at 14:05 UTC
    I believe that this is an issue between win32::ole and windows. I had a similar problem that I could not figure out. I had code that would not run on my box, but it worked for someone else, I then used p2exe to compile the code, put it on a different file server, and it ran. I can not remember if the fix was to update my box with the latest patches and re-install perl or to revert to an older windows configuration, but that is where I would start looking.

    -Cameron
Re: Strange OLE ClassFactory cannnot supply requested class error
by richz (Beadle) on Aug 31, 2004 at 17:26 UTC
    Cameron, Thanks for your response. Unfortunately I have tried using p2exe and running it off a different filesystem but it didn't work. Also it is strange because I don't recall installing anything on my system between the time the script worked and it stopped working. Anyways, my last resort which I am about to resort to is to reimage my machine to get the exact same image I had to begin with. If you do happen to remember waht exactly you did that'd be great. Thanks.