All,
This is a follow up to Turn a perl script into a Win32 Service. It does not matter if I use SrvAny or Win32::Daemon, I can not get my application to run as a service using ActiveState Perl 5.10 and Vista.

I have had some success running an application just not my application. It seems that the culprit is Win32::OLE and Outlook.

use strict; use warnings; use Win32::OLE; use Win32::OLE::Const 'Microsoft Outlook'; my $outlook = Win32::OLE->new('Outlook.Application') or die Win32::OLE +->LastError; my $namespace = $outlook->GetNamespace("MAPI"); my $folder = $namespace->GetDefaultFolder(olFolderInbox) or die Win32 +::OLE->LastError; # <--- dead my $items = $folder->Items; print STDERR "Folder: ", $folder->Name, "\n"; print STDERR "Total entries: ",$items->Count, "\n"; __DATA__ The error message is something about "METHOD/PROPERTYGET getdefaultfol +der"

I haven't yet tried ActiveState's PerlSvc (part of their PDK) but I have put in a call to the sales department. I am at a complete loss and am hoping some wise monk knows what I am missing. If anyone can get the script above to work on AS 5.10 on Vista as a service (using any tool at all), I would be very appreciative.

cross posted

Cheers - L~R


In reply to Win32::OLE (Outlook) as a windows service by Limbic~Region

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.