in reply to Win32::API and 'short' arguments

If I remember correctly, all integer parameters in the Win32 API are 4 bytes long. Short, long... even boolean: all are padded to 4 bytes. And as Windows/Intel is in Little Endian mode, lowest byte first, you just have to use long for every integer.

That's also why "N" is the only integer prototype in Win32::API (old school style).

Replies are listed 'Best First'.
Re^2: Win32::API and 'short' arguments
by spurperl (Priest) on May 09, 2006 at 20:28 UTC
    That sounds like something that can explain the problem. Can you recall where it's documented, or where I can find some info / examples about it ?

    According to the Win32::API docs, 'N' is not the only integer prototype, there's also 'N'

      Can you recall where it's documented, or where I can find some info / examples about it ?
      No, it's just one of the first things you learn when using the API from (pre-.NET) VB. In fact, I often use the API declarations for VB as the starting point to convert them to Win32::API. You can do the same, just Google for inurl:Win32API.txt to find a copy.

      I've been Googling around for it on the net yesterday, but I haven't found it back in one sentence, at all. Sorry about that.

      According to the Win32::API docs, 'N' is not the only integer prototype, there's also 'N'
      Eh? I'm sure you mean 'I', and AFAIK that does mean the same as 'N'.