Simple COM methods (none or single arg) seem to work OK, but get error message
Win32::OLE(0.1601) error 0x80020005: "Type mismatch" in METHOD/PROPERTYGET "FlashLamp" argument 1 at CS1.pm line 199

when calling interface method with (in my case) three args; callable OK from VB.

Is this a Win32::OLE calling issue with multiple args, or do I need to look elsewhere?

Perl code:
$cs1 = Win32::OLE->GetActiveObject("CS.CSInterface1") or die "Coul +d not get interface CS1\n"; ... my ($on, $off, $count) = $_; # contains args !!! SHOULD USE ARRAY +HERE !!! $cs1->FlashLamp($on, $off, $count);

IDL:
[id(24), helpstring("method FlashLamp")] HRESULT FlashLamp([in] long OnDuration, [in] long OffDuration, [in] long FlashCount);

C++ code:

STDMETHODIMP CCSInterface1::FlashLamp(long OnDuration, long OffDuratio +n, long FlashCount) { return S_OK; }
Platform stuff:
WinXP SP1, ActiveState Perl 5.8.0.804

Thanks.

Update
Thanks! I couldn't see the wood for the trees.
Doh! Shows my Perl is rusty from a couple of years of non-use !
Used some code from some earlier work where I'd had a ref to a list, so I'd have had to deref it first anyhow !

But used an array now instead and all is well.
Cheers.

In reply to Type mismatch in Win32::OLE method call with multiple args by mikewhit_

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.