View Issue Details

IDProjectCategoryView StatusLast Update
0016287LazarusLCLpublic2011-12-01 11:23
ReporterJustin SmythAssigned ToPaul Ishenin 
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
PlatformWindows 7 64 bitOSWindows 7OS Version7600
Product Version0.9.28.3 (SVN)Product BuildWin64 
Target VersionFixed in Version0.9.29 (SVN) 
Summary0016287: Attemp to use createparented fails
DescriptionI cant get createparented to work , it crashes with devide by zero when attempting to run.
Steps To ReproduceCreate 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 Informationit fails on 24687 (SVN) & 24567 ( snapshot ) on used with FPC 2.5.1
TagsNo tags attached.
Fixed in Revision24692
LazTarget-
WidgetsetWin32/Win64
Attached Files

Activities

Paul Ishenin

2010-04-18 12:20

manager   ~0036780

Please test and close if ok.

Regardss your test - please attach a project archive next time. And in your example don't forget about form position after you create it parented.

Justin Smyth

2010-04-18 13:14

reporter   ~0036781

i have tried the lastest SVN it now doesnt give me an A/V but when i do the createparented it doesnt create the form in the given handle of the object in question ( ie the handle of the panel on the main form , the handle i pass in is Panel1.handle ) it isnt attached to the main panel , when you move the form , the form that was created is in the middle of the screen.

2010-04-18 13:14

 

WindowTest.zip (129,564 bytes)

2010-04-18 13:50

 

DeskBand.zip (133,516 bytes)

Justin Smyth

2010-04-18 13:51

reporter   ~0036782

I have uploaded the DLL which calls the createparented. it works but with the form with just a button on and all icons in the titlebar disable it shows them.

Please Assist.

Paul Ishenin

2010-04-18 14:32

manager   ~0036783

The second issue with DLL is not related to the first issue. Please open another bug reports for non-related issues.

Anyway, your test does not compile: "Fatal: Can't find unit Mplayer64Remote used by LazarusBandUnit"

Justin Smyth

2010-04-18 14:39

reporter   ~0036784

Please See bug report 16289.

Issue History

Date Modified Username Field Change
2010-04-18 11:30 Justin Smyth New Issue
2010-04-18 11:30 Justin Smyth Widgetset => Win32/Win64
2010-04-18 12:20 Paul Ishenin Fixed in Revision => 24692
2010-04-18 12:20 Paul Ishenin LazTarget => -
2010-04-18 12:20 Paul Ishenin Status new => resolved
2010-04-18 12:20 Paul Ishenin Fixed in Version => 0.9.29 (SVN)
2010-04-18 12:20 Paul Ishenin Resolution open => fixed
2010-04-18 12:20 Paul Ishenin Assigned To => Paul Ishenin
2010-04-18 12:20 Paul Ishenin Note Added: 0036780
2010-04-18 13:14 Justin Smyth Status resolved => assigned
2010-04-18 13:14 Justin Smyth Resolution fixed => reopened
2010-04-18 13:14 Justin Smyth Note Added: 0036781
2010-04-18 13:14 Justin Smyth File Added: WindowTest.zip
2010-04-18 13:50 Justin Smyth File Added: DeskBand.zip
2010-04-18 13:51 Justin Smyth Note Added: 0036782
2010-04-18 14:32 Paul Ishenin Status assigned => resolved
2010-04-18 14:32 Paul Ishenin Resolution reopened => fixed
2010-04-18 14:32 Paul Ishenin Note Added: 0036783
2010-04-18 14:39 Justin Smyth Note Added: 0036784
2011-12-01 11:23 Marc Weustink Status resolved => closed