rovingeyes has asked for the wisdom of the Perl Monks concerning the following question:

I couldn't get Win32::API to compile on 64-bit Window 7. And AFAIK, it probably doesn't. If it does, could you please provide me a link or instructions on how to get it to compile on windows7? Otherwise, what I wanted to know was if there was any alternative to using Windows API in Perl directly (i.e. without using Win32::API)? Thanks.

Replies are listed 'Best First'.
Re: Win32::API & 64-bit Windows
by BrowserUk (Patriarch) on Feb 24, 2010 at 19:46 UTC

    Using a compiler and Inline::C is the simplest.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Wouldn't distribution become a problem, since Inline::C requires a C compiler? But, that actually made me look for Win32::OLE & indeed it is available for 64-bit version of Perl. I think a better alternative would be create a dll & expose the methods that can be consumed directly via perl. Sounds like this might be a friendlier approach to distributing my code. What do you think?

        Inline C produces a dll. That can be packaged and distributed without having to be compiled by every user, but that's not how it is normally done. Though, if the module builds successfully on the AS build servers, then a PPM (binary distribution) becomes available, which satisfies the needs of those who don't have a C compiler.

        One of the problems with producing a Win64 package, is that the MS C compiler no longer supports inline assembler. That means moving to using MASM64 to build the interface components, but the Perl build process doesn't support that; and it wouldn't work with non-MSC compiler suites. On top of that, MASM64 is barely functional and barely supported.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.