Hello Great Ones

I have a problem understanding passing variants by reference and returning the changed variant value by the method the object is calling!

Example.....
use strict; use Win32::OLE; use Win32::OLE::Variant; my $obj = Win32::OLE->new('Server.SpellCheck') or die "Can not start +server\n"; my $word = 'testt'; my $lang = 24941; my $dic = ''; my $opt = 303872; my $dpt = 70; # start the server by calling the REG TREE # it is using for this spell check session $obj->Start('SOFTWARE\abc spell\\' . $lang); # create the place holder for the suggestions # list returned by the Suggest() method below my $sugg = Variant(VT_BSTR|VT_BYREF, ""); # call the Suggest() method to get the suggestions # for the misspelled word, held in $word value! $obj->Suggest($word, $dpt, $lang, $dic, $opt, $sugg); print $sugg . "\n";

$sugg, should return a list of suggestions by reference but it does not! So can someone show me what I am doing, because I thought I followed the Doc....

OLE DOCS... Variants by reference Some OLE servers expect parameters passed by reference so that they ca +n be changed in the method call. This allows methods to easily return multi +ple values. There is preliminary support for this in the Win32::OLE::Varia +nt module: my $x = Variant(VT_I4|VT_BYREF, 0); my $y = Variant(VT_I4|VT_BYREF, 0); $Corel->GetSize($x, $y); print "Size is $x by $y\n";

Thank You

Dawn

Edited by Chady -- fixed formatting.


In reply to Win32::OLE (Variants by reference) by @dawn

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.