Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-07

Win32 API call GetSystemInfo in {$Mode Delphi} fails

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

The win32 API call, GetStartupInfo() fails under FPC with {$Mode Delphi} and no preceding @ sign in the parameter. Under Delphi 7 you can call GetStartupInfo as show below.

---------- Delphi [System.pas]  ------------------------
procedure GetStartupInfo(var lpStartupInfo: TStartupInfo); stdcall;
  external kernel name 'GetStartupInfoA';
example of usage:
function GetCmdShow: Integer;
var
  SI: TStartupInfo;
begin
  Result := 10;
  GetStartupInfo(SI);
  if SI.dwFlags and 1  0 then
    Result := SI.wShowWindow;
end;
----------------------------------------
----------- FPC [ascfun.inc]  --------------------------
procedure GetStartupInfo(lpStartupInfo:LPSTARTUPINFO); external
'kernel32' name 'GetStartupInfoW';

Under FPC it must be called as follows, it DELPHI mode or ObjFPC mode. [ ... ]

  GetStartupInfo(@startupinfo);

[ ... ]

----------------------------------------------------

Under FPC the GetStartupInfo parameter is defined differently to Delphi. Is this a bug in FPC?

Regards,
Graeme.

There's no place like 127.0.0.1

Reply by email

Marco van de Voort
to Graeme Geldenhuys
The win32 API call, GetStartupInfo() fails under FPC with {$Mode Delphi} and no preceding @ sign in the parameter. Under Delphi 7 you can call GetStartupInfo as show below.

Fixed in trunk. r4238 in case sb wants to merge it.

Reply by email