> Summing it up: you have to use LongBool (or Windows.Bool) when
> translating WinAPI functions that take or return BOOL type. Boolean is
> not correct, even if it sometimes works.
Actually, you're right up to a point. You should return BOOL, but a Boolean
value will auto convert when assigned a B
Matt Emson wrote:
...
It should be boolean. All Win32API return values which are BOOL translate as
Boolean.
That's not true. WinAPI uses BOOL type, it's defined in WinAPI headers as
typedef int WINBOOL,*PWINBOOL,*LPWINBOOL;
...
typedef WINBOOL BOOL;
So BOOL is int. So it's 32-bit value on 32-
> > To be fair to you, FPC should have always used StdCall for Win32API
calls.
> > It would be less confusing now, anyway.
>
> FPC always did add stdcall, since FPC didn't use stdcall by default, but
> what now is "oldfpccall" in 1.9.x.
>
> However policy was and is to flag them as stdcall. A
> > >4. This is not important for FPC 1.0.x, but for newer FPC remember to
> > >declare WinAPI functions as "stdcall" (FPC 1.0.x just used "stdcall" by
> > >default).
> >
> > I'll make note of that.
>
> To be fair to you, FPC should have always used StdCall for Win32API calls.
> It would be less
> That's awfully odd, because according to the Win32 API reference the
> function GetCurrentHwProfile requires a pointer, which pProfileInfo is
> (tProfileInfo is just the type definition). Guess I have some more reading
> to do.
No, it makes a lot of sense. You could use:
(var value: TProfil
Jim Wilson wrote:
At 12:00 AM 6/22/2004, you wrote:
You made a few mistakes translating GetCurrentHwProfile to Pascal:
Figures it was me... :-)
1. parameter to GetCurrentHwProfile should be TProfileInfo, not
PProfileInfo (using "var" parameter already forces passing HWProfile
by reference)
Tha
At 12:00 AM 6/22/2004, you wrote:
You made a few mistakes translating GetCurrentHwProfile to Pascal:
Figures it was me... :-)
1. parameter to GetCurrentHwProfile should be TProfileInfo, not
PProfileInfo (using "var" parameter already forces passing HWProfile by
reference)
That's awfully odd, bec
> I'm trying to get a Win32 API call to work, but either I found a bug in
> FPC
> (not likely) or I'm doing something wrong (more then likely).
>
> There's an API function called GetCurrentHwProfile that doesn't seem to be
> recognized by FPC, so I added it myself using external. However, when I
>
Hi
You made a few mistakes translating GetCurrentHwProfile to Pascal:
1. parameter to GetCurrentHwProfile should be TProfileInfo, not
PProfileInfo (using "var" parameter already forces passing HWProfile by
reference)
2. result of GetCurrentHwProfile should be LongBool (4 bytes), not
boolean (1
I'm trying to get a Win32 API call to work, but either I found a bug in FPC
(not likely) or I'm doing something wrong (more then likely).
There's an API function called GetCurrentHwProfile that doesn't seem to be
recognized by FPC, so I added it myself using external. However, when I try
callin
10 matches
Mail list logo