I didn't delve deep into the Win32::API internals, but I had previously success by using the other, packed style of parameter declaration:
use Win32::API; my $inc_number = Win32::API->new('testdll.dll','inc_number',"P","I"); sub inc_number { $inc_number->(@_); };
The P passing style passes a pointer to the value of the variable, but I'm not sure whether the variable will be magically converted to an int or be passed as string, so you maybe have to pack the value to a 4 byte string with the first byte being 0x08.
perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
In reply to Re: Win32::API - Passing "by reference"
by Corion
in thread Win32::API - Passing "by reference"
by EricDB
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |