You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Foo Ji-Haw <jh...@nexlabs.com> on 2005/09/21 07:23:15 UTC

Creating multiple Win32::OLE instances (Outlook.Application)

Hi all,

I am trying to see if mp2 is able to support modules that create Win32::OLE objects, process it, then destroy them.

I have a very simple script to try this task:
use strict;
use warnings;
use Apache2::Const -compile => qw(FORBIDDEN OK);
use Apache2::RequestRec;
use Apache2::Request;
use Win32::OLE;
BEGIN
{
 Win32::OLE-> Initialize(Win32::OLE::COINIT_MULTITHREADED);
}
use Win32::OLE::Variant;
use Win32::OLE::Const 'Microsoft Outlook';

sub handler
{
 my $r = shift;
 
 my $outlook = Win32::OLE->new('Outlook.Application');
 $outlook->Uninitialize;
 print "Hello world!!";
 
   return Apache2::Const::OK;
}

1;

Unfortunately, the page hung. I've tried reading up on other people's responses, but it's all very vague to me as to whether this is actually possible. By the way, it works well from the command line (after taking out the MP2 overheads).

If you have any ideas how to get this working, please let me know! Thanks!