Thank you, I understand that I'm in the wierd option of 32 bit perl for 64 int, Intel and Windows XP (but perl running through Cygwin). I think your post will be very helpful when I make the simplified example from my previous post work and I move into the original problem.

As a quick refresh, the simplified example from my previous post:

#### import an API that uses this structure my $getCursor = new Win32::API('user32', 'GetCursorPos','S','N'); #### create a 'POINT' object $lpPoint=pack('LL',0,0); #### call the function passing our structure object $getCursor->Call($lpPoint); #### and now, access its members my ($x,$y) = unpack('LL',$pt); print "The cursor is at: ".$x.", ".$y."\n";
No matter which parameter I use within pack ('J','L','N','Q' or 'V') in $lpPoint=pack('LL',0,0); I still get the error "Can't call method Pack on a undefined value". The error pops up in $getCursor->Call($lpPoint);.

From CPAN doc on Win32::API seems that I can substitute the Win32::API::Struct for the packed variable and then pass it to the Win32::API object. Any idea what I'm missing?


In reply to Re^2: Low-level version of Win32::API::Struct by sgv_81
in thread Low-level version of Win32::API::Struct by sgv_81

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.