Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

by BrowserUk (Pope)
on Jun 02, 2004 at 19:42 UTC ( #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
Node Status?
node history
Node Type: note [id://359687]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2020-09-18 21:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (113 votes). Check out past polls.

    Notices?