Hi, I am trying to use Win32 OLE to call a function that retrieves an array of bytes. This function expects a VARIANT pointer like the following. Read(int address, unsigned short bySize, VARIANT *byData); And the Perl code is as follows.
use Win32::OLE; use Win32::OLE::Variant; my $re = Win32::OLE->new('Read.ReadService') || die("Unable to open Re +adService ", Win32::OLE->LastError()); #Variables my $dat; my $temp; #$dat = Variant(VT_UI1|VT_ARRAY|VT_BYREF, 1); $dat = Variant(VT_EMPTY, 1); $re->Read(0xE0000, 13, $dat); foreach $temp ($dat) { print "0x".$temp; }
I have tried many different ways to pass the variant but no luck. Can anyone point me to the right way to pass the variant to retrieve the data back? Any suggestions would be very helpful? Thanks.

In reply to Trouble retrieving array of bytes using OLE by eforperl

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.