Attemp to use createparented fails
Original Reporter info from Mantis: delphian
-
Reporter name: Justin Smyth
Original Reporter info from Mantis: delphian
- Reporter name: Justin Smyth
Description:
I cant get createparented to work , it crashes with devide by zero when attempting to run.
Steps to reproduce:
Create a form using create parented
as per example
form1 -
code
unit AppMain;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
StdCtrls, ExtCtrls, Windows, Messages, lMessages;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Panel1: TPanel;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
uses MainUnit2;
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
Form2 := TForm2.CreateParented(Panel1.Handle);
Form2.Show;
SendMessage(Form2.Handle, WM_NCACTIVATE, Ord(True), 0);
end;
end.
form2.
unit MainUnit2;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
StdCtrls;
type
{ TForm2 }
TForm2 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.lfm}
{ TForm2 }
procedure TForm2.Button1Click(Sender: TObject);
begin
close;
end;
end.
LFM for form2
object Form2: TForm2
Left = 420
Height = 240
Top = 214
Width = 320
BorderIcons = []
BorderStyle = bsNone
Caption = 'Form2'
ClientHeight = 240
ClientWidth = 320
LCLVersion = '0.9.29'
object Button1: TButton
Left = 120
Height = 25
Top = 104
Width = 75
Caption = 'Button1'
OnClick = Button1Click
TabOrder = 0
end
end
Additional information:
it fails on 24687 (SVN) & 24567 ( snapshot ) on used with FPC 2.5.1
Mantis conversion info:
- Mantis ID: 16287
- OS: Windows 7
- OS Build: 7600
- Build: Win64
- Platform: Windows 7 64 bit
- Version: 0.9.28.3 (SVN)
- Fixed in version: 0.9.29 (SVN)
- Fixed in revision: 24692 (#d661819e)