Subject Re: [IB-Architect] IBConsole
Author Doug Chamberlin
At 9/1/2000 10:30 AM (Friday), Ken Richard wrote:
>I don't know delphi and don't even have delphi, so I can't fix it. I asumme
>the fix would look like:
>
> if FindWindow('IB_Server','Interbase Server') != null
> result := false
> else
> result := true;
>
>If this fix is valid, is there anyone who can apply the changes and compile
>a new binary?

I agree you are right to question that coding.

However, a couple of details are troublesome.

1) The existing code looks to me like it is testing for the IB_Server
window to NOT be the next window in Z-order. Either that or the result
values are reversed.

2) The fix you propose is almost right. There is no NULL identifier defined
in Delphi so we need to test against 0.

3) I would reverse the result values if the function is really saying
whether the server process is running. Perhaps this code will work correctly:

function IsIBRunning(): boolean;
begin
Result := (FindWindow('IB_Server','Interbase Server') <> 0);
end;

Unfortunately I cannot rebuild IBConsole at this point. Hopefully someone
else can pick it up from here.