I am using a Win32 COM API that has a function that takes several parameters and assigns values to the variables. Here is the code in VB that I'm trying to convert to Perl.
Sub GetData(Number As Long, Prices() As Single, OtherDataPoints() As S +ingle)
Here is the pseudo code I am trying to use to make it work:
my $object = Win32::OLE->new('ClassID'); # this works correctly. my $number = 1; my $prices; my $others; my $returnValue = $object->GetData($number,$prices,$others); # always fails with Win32::OLE(0.1701) error 0x80020005: "Type mismatc +h" in argument 2
Does anyone know what variant type I need to assign to $prices and $others that is equivalent to VB's "As Single"? I've tried several of the variant types found in the Win32::OLE::Variant perldoc, but so far I'm striking out.

Dave

In reply to Win32::OLE Type for VB's "As Single" by davemabe

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.