in reply to Re: Low-level version of Win32::API::Struct
in thread Low-level version of Win32::API::Struct
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:
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);.#### 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";
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Low-level version of Win32::API::Struct
by bulk88 (Priest) on Aug 01, 2012 at 17:32 UTC |