Hi, relitivly new to the wonderful world of perl (4 weeks to be exact),so this may well be a stupid question, feel free to point this out at your leasure. Anyway, to the matter in hand: I am using win32::ole::variant to set up a 2 byte signed variant variable

i.e.
my $registerIndex = Win32::OLE::Variant::Variant(Win32::OLE::Variant:: +VT_I2|Win32::OLE::Variant::VT_BYREF,0);
This variant is needed as i call another program, that i use to communicate with the parallel port (program is called v2wReg, and i think it is exclusive to the company i am doing a summer placement for, but could be mistaken), and in its documentation it dictates that i MUST pass a variant into it in order to read from the register the parallel port is connected to.

The documentation looks like this -:

VARIANT ReadRegisterNoWrite( LONG nDevLocation,VARIANT* nIndex,VARIANT +* nValue,VARIANT* bAutoIncrement);
Thus indicating which variables go where. I know that the first two variant variables will return 1 byte and the autoincrment variant will return 1 bit.

No matter what i pass into the function ReadRegisterNoWrite i get no return (i.e. nothing happens to the variables that i pass in) and the same error (only with 'use warnings;' in my code though) of:

Win32::OLE(0.1501) error 0x80020005: "Type mismatch" in METHOD/PROPERT +YGET "ReadRegister" argument 3 at trial.pm line 49
I am totally stumped as to how to avoid this error and get a good reaading from the register so any light anyone one of you monkees could spread onto this problem would be much appreciated.

cheers.

The SleepingMonk

p.s. if it helps any I am using i2c to talk to the register at the parallel port. (v2wReg is a program that allows perl to communicate with i2c devices)

update (broquaint): added <code> tags


In reply to WIN32::OLE::VARIANT --- the destroyer of souls ??? by SleepingMonk

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.