Hello fellow coders,

I'm having a problem registering a Microsoft OLE class using Win32::OLE. I'm trying to do some voice recognition using the Speech.VoiceCommand object that comes with the Microsoft Speech API. I've already gotten Perl to talk using Speech.VoiceText by using examples posted here. (PS: Thanks for that!)

When I try to register the Speech.VoiceCommand object, I get the following error:

Win32::OLE(0.1502) error 0x80020009: "Exception occurred in METHOD/PROPERTYGET "Register" at hear.pl line 14

I don't know how to _start_ debugging this! I tried reinstalling the Microsoft Speech API, but it didn't help. I created my code by hacking up some source code from the MisterHouse code on sourceforge. Thanks in advance!!

Here's my code: --------------------------------------------------------

use Win32::OLE; use strict; my $vcmd_ms; $Win32::OLE::Warn = 1; # Warn if ole fails eval {$vcmd_ms = Win32::OLE->GetActiveObject('Speech.VoiceCommand')}; die "VoiceCommand not installed" if $@; unless (defined $vcmd_ms) { $vcmd_ms = Win32::OLE->new('Speech.VoiceCommand'); die Win32::OLE->LastError if (Win32::OLE->LastError()); } $vcmd_ms->Register(""); # this is the line that barfs die Win32::OLE->LastError if (Win32::OLE->LastError());

In reply to Win32::OLE: Problems registering Speech.VoiceCommand by Anonymous Monk

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.