0

For my sins, I run a legacy Perl 5.24 install on which I have built an app of 15 years standing. Recently I have discovered that my Microsoft Outlook integration needed to send scheduled emails breaks on Windows boxes with 64 bit Office installs, while it runs fine with 32 bit Office installs.

The exact error thrown is:

No type library matching "Microsoft Outlook" found at ../Perl/lib/Mail/Outlook.pm line 111

While there do appear to be plenty of people who've encountered this issue, I do have some constraints which is why their solutions might not apply to my situation. First, I am unfortunately not open to upgrading my installation. Given enough time, I'd love to do that but there's never enough time, especially when there are tight deadlines! Second, I do not have the ability to directly manually tinker with the Registry settings on the machines this application must run on, as local admin rights are locked down.

I'm definitely not afraid though of tinkering with the modules. There are no external dependencies I have to satisfy so it is my private playground to hack around as I like with.

How would I go about finding the exact changes needed at the Module level (or even as calls in my code) to address this issue? I've taken a good look around the Meta CPAN site but am none the wiser (all I can see is file permission and version bumps). I still want the application to run with 32 bit Office installs as well as 64 bit Office installs.

13
  • Perhaps you should include some code that demonstrates what you are trying to do, and what modules you are using. Commented Mar 21 at 16:05
  • Try to run procmon.exe from SysInternals against your app to see where which calls are failing. I am 90% sure Perl does not find the expected registry keys when it probes for the COM registration entries. Outlook is an out-of-proc COM server and can be accessed from both 32 and 64 bit apps just fine, but I do not know how Perl handles the 32 vs 64 bit COM registry entries. Commented Mar 21 at 16:16
  • @TLP My usage is very simple. I just instantiate Mail::Outlook objects to generate emails. Unfortunately I am not able to copy / paste here and am not really seeking to re-tool the way in which I achieve this outlook integration. Just something quick and simple would be fine. Commented Mar 21 at 16:23
  • @DmitryStreblechenko Sorry but I don't have access to those tools, but can see which calls are failing. The relevant information is in the question. Commented Mar 21 at 16:24
  • It is a free tool from Microsoft: learn.microsoft.com/en-us/sysinternals/downloads/procmon Commented Mar 21 at 16:58

2 Answers 2

2

Check that you have HKEY_CLASSES_ROOT\Wow6432Node\TypeLib\{00062FFF-0000-0000-C000-000000000046} registry key - note Wow6432Node: since you app is 32 bit, it looks up in the 32 bit hive. Most likely you only have HKEY_CLASSES_ROOT\TypeLib\{00062FFF-0000-0000-C000-000000000046}.
You can either run the 64 bit version of Perl, or recreate the registry key in Wow6432Node.

Also note that Perl looks for a substring match when it enumerates all type libraries (yuck).
See if you can change that line to
use Win32::OLE::Const '{00062FFF-0000-0000-C000-000000000046}';

Sign up to request clarification or add additional context in comments.

5 Comments

Thank you for this answer, however for reasons explained in the question, I cannot either edit the registry or drastically upgrade my underlying Perl install. Obviously I wish I had the time to do that but in the real world I get maybe an hour or two at most to solve these sorts of problems. I'm looking for a quick n dirty hack of the relevant modules to work around the issue. A pointer would be gratefully appreciated if anyone has come across a similar situation with Office 64 incompatibility with older Perl installs.
Looks at the updated answer to see if it works for you.
Thanks a lot for these suggestions. Unfortunately, I don't have any way to edit the Registry at the scale required (no local admin privileges plus ultra-paranoid security admins). I tried referencing the enumerated constant directly as you suggest (after verifying that it exists for me), but no dice. Same error, different text.
Have you tried to use 64 bit Perl?
Hi Dmitry, unfortunately the issue has persisted after updating to 64 bit 5.40 Perl. I will see if I can trial the registry change as suggested.
0

Just wanted to close this question by confirming that I have come to the conclusion that a major Perl version upgrade is the only way forwards. Registry editing is sadly not an option in this environment.

In the short term I can simply work around the integration failure using a switch I put there earlier for that purpose, but I agree with others, there really is no alternative. I should be doing this periodically anyway, but justifying the time required is always hard, especially now.

2 Comments

did editing the Mail::Outlook code to do use Win32::OLE::Const '{00062FFF-0000-0000-C000-000000000046}'; work (assuming that uuid is correct for your systems, which you should verify) as suggested by Dmitry?
Hello! I did verify and the key exists in the target system. Updating the code as suggested unfortunately makes no difference. I've recently re-implemented on 64 bit 5.40 Perl and have found the same issue. Next step is trial a regedit change (via admins) to see if this picture improves.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.