Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: c style Win32::API interface

by Roger (Parson)
on Oct 05, 2004 at 06:10 UTC ( [id://396490]=note: print w/replies, xml ) Need Help??


in reply to c style Win32::API interface

There is a bug in the prototype definition. The quickest solution is to patch the Win32::API module by 'voiding' the custom prototype.

... my $f = Win32::API->new("winmm", "long mciSendString(LPSTR a, LPSTR b, + long c, long d)"); delete $f->{proto}; delete $f->{intypes}; ...

This will force Win32::API to behave the same as
Win32::API->new("winmm", "PPNN", "N");


It is often useful to turn on the internal debugging of Win32::API to work out what is the prototype parser doing. Turn on debugging with $Win32::API::DEBUG = 1;. This shows that in your first prototype, the char * was interpreted as char. Win32::API was not doing a good job at parsing char *. (grin...)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://396490]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2024-04-24 09:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found