Announcement

Collapse
No announcement yet.

pb4 vs. pb5 winapi

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • pb4 vs. pb5 winapi

    this declartion works with pbcc4:
    Code:
    Declare Function getstdhandle Lib "kernel32.dll" Alias "getstdhandle" (ByVal nstdhandle As Long) As Long
    but not pbcc5 where I get a "mismatch with prior definition" error, even if I specify the pbcc5 win32api.inc.


    why?

  • #2
    In the Win32Api.inc file that ships with PBCC 4 and PBCC 5, both have this function defined as:
    Code:
    DECLARE FUNCTION GetStdHandle LIB "KERNEL32.DLL" ALIAS "GetStdHandle" (BYVAL nStdHandle AS DWORD) AS DWORD
    Notice that the parameter and return values are DWORDs and not LONGs. I can only guess that you modified the Win32Api.inc file that shipped with version 4.
    Sincerely,

    Steve Rossell
    PowerBASIC Staff

    Comment


    • #3
      that worked, don't know how I missed that

      thanks!

      Comment


      • #4
        I don't know why it would/should error out at compile time.

        BYVAL LONG/DWORD put the same bits on the stack, and when Windows returns 32 bits, you can read 'em as anything of that size (LONG, DWORD, SINGLE).

        Methinks the folks in Florida are being a tad over-protective.
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]
        http://www.talsystems.com

        Comment


        • #5
          Originally posted by Michael Mattias View Post
          Methinks the folks in Florida are being a tad over-protective.
          Hurricanes will do that to ya.

          Comment

          Working...
          X