FillRgn fails with an unknown error in a converted project
Original Reporter info from Mantis: Maxerist
-
Reporter name: Max Vlasov
Original Reporter info from Mantis: Maxerist
- Reporter name: Max Vlasov
Description:
I found that for my Delphi-originated project converted in Lazarus FillRgn didn't work. I narrowed this to the following simple code fragment
procedure TForm1.FormPaint(Sender: TObject);
var
Rgn: HRgn;
begin
Rgn:=CreateRectRgn(0, 0, 100, 100);
try
if not FillRgn(Canvas.Handle, Rgn, GetStockObject(BLACK_BRUSH)) then
RaiseLastWin32Error;
finally
DeleteObject(Rgn);
end;
end;
If this code added to a new project created from the IDE, everything is ok.
But if:
- I create a simple project with a form in Delphi (5)
- Convert this simple project with the Lazarus internal converter (successfully converted)
- Add the same fragment to the Form OnPaint event
An error EOSError ("an operating system call failed") is fired when the project is started.
Additional information:
I compared the options of the project, the only one I noticed was Win-Gui Application that converted didn't set for some reason, but setting it to the correct value didn't help
I also uploaded here the project after it was converted (TestConv.lpi TestConv1.dfm TestConv1.pas TestConv.dpr)
Mantis conversion info:
- Mantis ID: 19395
- Version: 0.9.31 (SVN)
- Monitored by: » Maxerist (Max Vlasov)