Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: How to make Win32::API easy to use

by BrowserUk (Patriarch)
on Jun 02, 2004 at 19:42 UTC ( [id://359687]=note: print w/replies, xml ) Need Help??


in reply to How to make Win32::API easy to use

I think that Win32::API::Prototype makes it easier than the Win32::API.

use Win32::API::Prototype; ApiLink( 'Kernel32', q[ HANDLE CreateIoCompletionPort( HANDLE FileHandle, HANDLE ExistingCompletionPort, ULONG_PTR CompletionKey, DWORD NumberOfConcurrentThreads )] ); my $hIOCP = CreateIoCompletionPort( $hSocket, 0, 0, 0 );

Maybe a combination of that and your import function would simplify it further?


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail

Replies are listed 'Best First'.
Re^2: How to make Win32::API easy to use (::Prototype)
by tye (Sage) on Jun 02, 2004 at 20:03 UTC

    I'd look at Win32::API::Prototype but it doesn't appear to be on CPAN (to which your link points). Google says it is a Roth module. I tend to avoid non-CPAN modules for a lot of reasons...

    Ahh, nice, this one includes source code and it is all in Perl (which means the usual reason Roth gives for not putting on CPAN shouldn't apply; maybe that will happen). It appears to do quite simple translation from typedef'd types to Win32::API types, which isn't at all what I was thinking it would do (I find that this step is usually the easiest step).

    So the two methods could probably be merged rather easily.

    - tye        

      It is on CPAN: here. Hopefully that link will take you direct to the source. It does me. The other link was from the search.cpan.org page, amd it doesn't link, though other links from the same entry do?

      It does also export the entrypoint name into the calling code as yours would.


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail

        Ah. The problem isn't that the module was not placed on CPAN. The problem was that the module was never really constructed as a CPAN module, but is instead simply a *.zip file containing a single *.pm file in a nested subdirectory.

        - tye        

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-26 02:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found