Recent

Author Topic: control '' has no parent  (Read 7128 times)

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1158
Re: control '' has no parent
« Reply #15 on: August 30, 2018, 02:18:33 pm »
Quote
"There was a time when you typed sudo apt-get install [package] (or yum, pacman, dnf, etc.) in your terminal, then, a list of dependencies of that package were shown and you were prompted if the installation should proceed.
But now, and innovative revolution has risen: cross-distribution applications. This time, I will make a comparison of three major formats: AppImage, Flatpak and Snaps."

And they are all centered on very isolated apps like mobile apps are. Something which is pretty useless for a development system. Moreover, if I run Lazarus+FPC in such container, will the generated app also need the container's runtime (as opposed as the distro one?)

Again a solution for rare cases, and the longevity (as opposed to cross install or cross distro) has still to be determined (and my hopes are not very high)

Since there are so many little changes that cause the breakage and the problems, I don't expect new tech to really change anything, except when it flat out guarantees package to remain working for xxx years. (e.g. because they have a compatibility subsystem for it, like FreeBSD's compat, or Linux IBCS, long,long ago)


Is your setup current? Trunk changes by the day if not hours.
@marcov, I understand what you mean about longevity of rules.
If FPC and Lazarus change so fast having only dozens of core developers, I don't know how to expect Linux not to change even faster having thousands of core developers for its kernel, programs and libraries.
For the last 30 years, what I see most is software being released faster and faster as time goes by, take LibreOffice (first StarOffice, then OpenOffice) and Firefox as examples. Their first releases took years for new updates, now it take only weeks. Even Linux now has many updates and some new versions per year.

https://wiki.documentfoundation.org/ReleasePlan/6.1
https://wiki.mozilla.org/Release_Management/Calendar
https://en.wikipedia.org/wiki/Linux_kernel#Timeline

toby

  • Sr. Member
  • ****
  • Posts: 275
Re: control '' has no parent
« Reply #16 on: August 30, 2018, 03:25:45 pm »
Thaddy

Thanks for testing on your own vnc and hdmi tv - now i have no clue what is wrong!

---

The X11 is running  - i have fluxbox and i can run gvim and seamonkey in it etc

---

here is output from /usr/local/bin/lazarus in an xterm on the rpi3b

Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/root/.lazarus"
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus"
TWinControl.CreateWnd SplashForm:TSplashForm Parent=nil ERROR WndParent=0
[FORMS.PP] ExceptionOccurred
  Sender=EInvalidOperation
  Exception=Control 'SplashForm' has no parent window
  Stack trace:
  $0000000000852EEC  CREATEWND,  line 7547 of include/wincontrol.inc
  $00000000006E1174  CREATEWND,  line 2703 of include/customform.inc
  $00000000006E2C8C  CREATEWND,  line 3171 of include/customform.inc
  $00000000008528E8  CREATEHANDLE,  line 7463 of include/wincontrol.inc
  $000000000085457C  HANDLENEEDED,  line 7913 of include/wincontrol.inc
  $0000000000845F20  CHECKHANDLEALLOCATED,  line 3478 of include/wincontrol.inc
  $00000000008458F8  DOALLAUTOSIZE,  line 3529 of include/wincontrol.inc
  $000000000086D97C  ENABLEAUTOSIZING,  line 5741 of include/control.inc
  $0000000000868F6C  SETVISIBLE,  line 4559 of include/control.inc
  $00000000006D86AC  SETVISIBLE,  line 492 of include/customform.inc
  $00000000006DFE50  SHOW,  line 2330 of include/customform.inc
  $0000000000704B88  SHOW,  line 133 of splash.pp
  $00000000006681A0  main,  line 137 of lazarus.pp
  $0000007FB834D364
  $0000000000667E68
TApplication.HandleException: EInvalidOperation
Control 'SplashForm' has no parent window
  Stack trace:
  $0000000000852EEC  CREATEWND,  line 7547 of include/wincontrol.inc
  $00000000006E1174  CREATEWND,  line 2703 of include/customform.inc
  $00000000006E2C8C  CREATEWND,  line 3171 of include/customform.inc
  $00000000008528E8  CREATEHANDLE,  line 7463 of include/wincontrol.inc
  $000000000085457C  HANDLENEEDED,  line 7913 of include/wincontrol.inc
  $0000000000845F20  CHECKHANDLEALLOCATED,  line 3478 of include/wincontrol.inc
  $00000000008458F8  DOALLAUTOSIZE,  line 3529 of include/wincontrol.inc
  $000000000086D97C  ENABLEAUTOSIZING,  line 5741 of include/control.inc
  $0000000000868F6C  SETVISIBLE,  line 4559 of include/control.inc
  $00000000006D86AC  SETVISIBLE,  line 492 of include/customform.inc
  $00000000006DFE50  SHOW,  line 2330 of include/customform.inc
  $0000000000704B88  SHOW,  line 133 of splash.pp
  $00000000006681A0  main,  line 137 of lazarus.pp
  $0000007FB834D364
  $0000000000667E68

---

this is output from  gg  after compiling in an xterm

TWinControl.CreateWnd :te Parent=nil ERROR WndParent=0
[FORMS.PP] ExceptionOccurred
  Sender=EInvalidOperation
  Exception=Control '' has no parent window
  Stack trace:
  $00000000005E17AC  CREATEWND,  line 7547 of include/wincontrol.inc
  $00000000004C89F4  CREATEWND,  line 2703 of include/customform.inc
  $00000000004CA50C  CREATEWND,  line 3171 of include/customform.inc
  $00000000005E11A8  CREATEHANDLE,  line 7463 of include/wincontrol.inc
  $00000000005E2E3C  HANDLENEEDED,  line 7913 of include/wincontrol.inc
  $00000000004D7EEC  CREATEFORM,  line 2256 of include/application.inc
  $000000000045F13C  main,  line 24 of gg.pas
  $0000007FB10BB364
  $000000000045EE18

---

taazz the code is in my original post

---

Thaddy

  • Hero Member
  • *****
  • Posts: 18765
  • To Europe: simply sell USA bonds: dollar collapses
Re: control '' has no parent
« Reply #17 on: August 30, 2018, 03:53:25 pm »
If FPC and Lazarus change so fast having only dozens of core developers, I don't know how to expect Linux not to change even faster having thousands of core developers for its kernel, programs and libraries.
Trunk is the development branch. Real releases have a rather conservative cycle. Averages once a year or once slightly over a year.
Just like with any other software the development branch is often way ahead of the release. Trunk is not for everybody.
The last release 3.0.4 is for everybody, as is - to test - a branched off 3.2.0. It is branched off of trunk because it is considered feature complete for a release, but needs testing before it is a real release.
Here we all are beta-testers if you choose to test the 3.2.0 branch, but you are alpha testers when you care to use trunk. Normal users should still use 3.0.4, if possible not less than 3.0.4.
The kitchen is rather open, which may fool many. Don't confuse the three (3.0.4, 3.2.0, 3.3.1). FPC devel are rather conservative in their release cycles, which is a.very.good.thing.
It is not only the code, but the docs, the packaging, etc, etc, and of course testing, testing, testing, all very boring things that need to be done.

But we wouldn't want to hide either trunk or pre-release and RC versions behind a subscription type vail, would we?
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

Thaddy

  • Hero Member
  • *****
  • Posts: 18765
  • To Europe: simply sell USA bonds: dollar collapses
Re: control '' has no parent
« Reply #18 on: August 30, 2018, 04:01:59 pm »
I guess he has not shared the problematic code yet. The complete thread looks like an exercise in futility to me.
Solving someone's issues is never futile because others including yourself and me can run into the same problem.
What I do agree is that he probably did not share all code: the code he shared works as per my screenshot which is obviously taken from a Pi.

Maybe he is cross-compiling from windows and has his cross-compiler wrong. I compiled natively on the Raspberry Pi itself.
« Last Edit: August 30, 2018, 04:04:03 pm by Thaddy »
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

toby

  • Sr. Member
  • ****
  • Posts: 275
Re: control '' has no parent
« Reply #19 on: August 30, 2018, 04:20:24 pm »
i am doing native compile on the rpi3b   

ppca64 -gl gg.pas





toby

  • Sr. Member
  • ****
  • Posts: 275
Re: control '' has no parent
« Reply #20 on: August 31, 2018, 02:43:37 pm »
This is clearly a bug in the code    the parent window is not getting defined by something missing and/or not checked on by the code

{------------------------------------------------------------------------------
  function TWinControl.GetParentHandle: HWND;
 ------------------------------------------------------------------------------}
function TWinControl.GetParentHandle: HWND;
begin
  if Parent <> nil then
    Result := Parent.Handle
  else
    Result := ParentWindow;
end;


toby

  • Sr. Member
  • ****
  • Posts: 275
Re: control '' has no parent
« Reply #21 on: October 11, 2019, 03:10:08 pm »
Well, I am writing everything (almost everything) I post on this forum on a Raspberry Pi of some sort (most likely RPi3) so I will have a go...
>Gimme a few seconds...

Oh, well, works!! (Why am I not amazed?)            because you are using 32 bit raspian and not a 64 bit os

Is your setup current? Trunk changes by the day if not hours.

I guess there are several hundredths of the several hundredths of users that have at least one Pi or similar.

comingnine

  • New Member
  • *
  • Posts: 26
Re: control '' has no parent
« Reply #22 on: July 08, 2025, 12:40:55 pm »
This is clearly a bug in the code    the parent window is not getting defined by something missing and/or not checked on by the code

{------------------------------------------------------------------------------
  function TWinControl.GetParentHandle: HWND;
 ------------------------------------------------------------------------------}
function TWinControl.GetParentHandle: HWND;
begin
  if Parent <> nil then
    Result := Parent.Handle
  else
    Result := ParentWindow;
end;

Could you suggest how you fixed or workaround the `control " has no parent window `error ?

dbannon

  • Hero Member
  • *****
  • Posts: 3725
    • tomboy-ng, a rewrite of the classic Tomboy
Re: control '' has no parent
« Reply #23 on: July 08, 2025, 01:00:56 pm »
comingnine did you notice that the code you quoted was seven years old ?

Quite a lot has changed since then. I suggest if you have a problem start a new thread, describe your hardware, OS and show us the code that does not work.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Thaddy

  • Hero Member
  • *****
  • Posts: 18765
  • To Europe: simply sell USA bonds: dollar collapses
Re: control '' has no parent
« Reply #24 on: July 09, 2025, 06:59:01 am »
@comingnine

I will have a look if I still have the working code I used. (see my first entry and screenshot).
As I remember it was fixed in seconds. The rest  of the thread was nonsense: there was no bug but a small omission.
The code is for linux and won't work on Windows. For windows you need to create a hidden window or use application.

But it is very likely that old code will not work anyway since indeed much has changed.
I suggest you open a new thread, give us a compilable - does not have to work - example and OS, bitness fpc version, lazarus version.
Then we can help you. It lis likely not much related to this thread.
« Last Edit: July 09, 2025, 07:09:45 am by Thaddy »
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

Thaddy

  • Hero Member
  • *****
  • Posts: 18765
  • To Europe: simply sell USA bonds: dollar collapses
Re: control '' has no parent
« Reply #25 on: July 09, 2025, 07:23:07 am »
Found the orginal code and compiled it:
Code: Pascal  [Select][+][-]
  1. program gg;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. uses interfaces, classes, forms;
  6.  
  7. type te = class(tform)
  8. constructor create(aowner: tcomponent); override;
  9. end;
  10.  
  11. var e : te;
  12.  
  13. constructor te.create(aowner: tcomponent);
  14. begin
  15. inherited createnew(aowner);
  16. end;
  17.  
  18. begin
  19.  
  20. requirederivedformresource := false; // default
  21.  
  22. application.initialize;
  23.  
  24. application.createform(te, e);
  25.  
  26. application.run;
  27.  
  28. end.
How?
1. Create a new GUI application.
2. Open project source
3. Delete all code (project source should be empty)
4. Paste the original code
5. Compile and run.
This makes sure all dependencies are set correctly in the newly created  lpi file.
The original code is otherwise untouched.

But that is likely not related to the last question.
« Last Edit: July 09, 2025, 07:51:06 am by Thaddy »
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

 

TinyPortal © 2005-2018