Sign in Join

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

Mailing lists / lazarus / 2010-04

Win32 CreateParented issue

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Justin Smyth

I've been playing with CreateParented and i have come across some issues where i am getting a A/V

I have got 2 forms , the first form has a panel on it and a button on it and the second form has just a button with close event attached to it.

The First for does this behind the button

  Form2 := TForm2.CreateParented(Panel1.Handle);
  Form2.Show;
  SendMessage(Form2.Handle, WM_NCACTIVATE, Ord(True), 0);

soon as i call the createParented it falls over . the form lfm

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

Anyone reproduce this or have i done something wrong

Justin Smyth
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100417/a4fd7529/attachment.html>

Reply by email

Duncan Parsons
to Justin Smyth

From: Justin Smyth [mailto:]
Sent: 17 April 2010 08:14

I've been playing with CreateParented and I have come across some

issues where I am getting a A/V

I have got 2 forms , the first form has a panel on it and a button on

it and the second form has just a button with close event attached to it.

Show quoted text 14 lines
The First for does this behind the button Form2 := TForm2.CreateParented(Panel1.Handle); Form2.Show; SendMessage(Form2.Handle, WM_NCACTIVATE, Ord(True), 0); soon as I call the createParented it falls over . Anyone reproduce this or have I done something wrong Justin Smyth

Don't know why it should fall over, but the implementation of CreateParented is wrong. I have something that works on Win, but have been trying to make it work on getting the OSX version working as well before submitting a patch; Laz is Xplatform, so just providing a single platform solution doesn't seem quite right to me. If I can get two working, then that seems reasonable.

There are a few places that need altering so that it will attach to a parent, I can post them if that would help you, but give a day or two to put it in order :-)

Duncan

Reply by email

Paul Ishenin
to Duncan Parsons
Duncan Parsons wrote
Don't know why it should fall over, but the implementation of CreateParented is wrong.

The problem was fixed.

Show quoted text 10 lines
I have something that works on Win, but have been trying to make it work on getting the OSX version working as well before submitting a patch; Laz is Xplatform, so just providing a single platform solution doesn't seem quite right to me. If I can get two working, then that seems reasonable. There are a few places that need altering so that it will attach to a parent, I can post them if that would help you, but give a day or two to put it in order :-)

I implemented setting ParentWindow on OSX a month ago and it worked in my tests. Maybe you have a more complex test to check. If so please upload it to the bug tracker.

Best regards,
Paul Ishenin.

Reply by email

Duncan Parsons
to Paul Ishenin
19.04.2010 19:03, Duncan Parsons wrote: > Don't know why it should fall over, but the implementation of > CreateParented is wrong.

The problem was fixed.

Show quoted text 14 lines
> I have something that works on Win, but have been trying to make it > work on getting the OSX version working as well before submitting a > patch; Laz is Xplatform, so just providing a single platform solution > doesn't seem quite right to me. If I can get two working, then that > seems reasonable. > > There are a few places that need altering so that it will attach to a > parent, I can post them if that would help you, but give a day or two > to put it in order :-) > I implemented setting ParentWindow on OSX a month ago and it worked in

my tests. Maybe you have a more complex test to check. If so please

upload it to the bug tracker. Best regards, Paul Ishenin.
Oh right! It was 6+ weeks ago I was last working on it, I have some time later this week, I'll check it out.. That's excellent news Paul :-) DSP

Reply by email