in reply to Win32::API missing types

Nemurenai,
There's a fairly simple demonstration of your point that can be taken from the Win32::API docs - one that doesn't need a laptop to test out.
Save the following file as 'mymod.pm':
package mymod; use warnings; use Win32::API; #### define the structure Win32::API::Struct->typedef( POINT => qw{ LONG x; LONG y; }); #### import an API that uses this structure Win32::API->Import('user32', 'BOOL GetCursorPos(LPPOINT lpPoint)'); #### create a 'POINT' object my $pt = Win32::API::Struct->new('POINT'); #### call the function passing our structure object GetCursorPos($pt); #### and now, access its members print "The cursor is at: $pt->{x}, $pt->{y}\n"; 1;
When you run that file as 'perl mymod.pm' you get output like the following (depending upon just where the cursor is located):
D:\pscrpt>perl mymod.pm The cursor is at: 584, 1017 D:\pscrpt>perl mymod.pm The cursor is at: 213, 542
Next, try running the following script (named 'test.pl'):
use warnings; use mymod;
That consistently produces the following output for me (with an accompanying segfault):
D:\pscrpt>perl test.pl Win32::API::parse_prototype: WARNING unknown output parameter type 'BO +OL' at D:/ perl58_M/site/5.8.8/lib/Win32/API.pm line 273. Use of uninitialized value in concatenation (.) or string at mymod.pm +line 21. Use of uninitialized value in concatenation (.) or string at mymod.pm +line 21. The cursor is at: ,
I can't offer a useful explanation of this ... but I guess it has something to do with the quirky way that Win32::API::Struct goes about doing whatever it is that Win32::API::Struct does.

I don't think that Win32::API::Struct enables you to do anything that can't be done by using simply Win32::API.
Win32::API::Struct merely simplifies the coding that's necessary. So you should be able to rewrite your code (using only Win32::API) in such a way that avoids the odd behaviour you've noted.

Cheers,
Rob