ThN
ThN

Reputation: 3276

Why would an application popup an error, "Control doesn't have parent window," after running for 3 weeks?

I have been running an application developed under Windows 7 in Delphi XE on Windows 7 machine for about 3 weeks non-stop, but it stopped working after that and popped up a message box with "Control doesn't have parent window." After that nothing seem to work right in the software, unless it is shutdown and restarted.

I have an idea of what that error means, but I am trying to figure out. Why?

Any hints or suggestions will be greatly appreciated. Thank you.

Upvotes: 2

Views: 252

Answers (2)

Remy Lebeau
Remy Lebeau

Reputation: 597101

You should install a copy of MadExcept, JclExcept, or other exception handling library that supports displaying/logging the call stack when an uncaught exception is raised (if you cannt reproduce the exception while running inside the IDE debugger, that is). Then you can figure out what your app was trying to do at the time of the exception, and hopefully narrow it down to the spot in your code that is accessing the specific UI control that is missing its Parent window.

Upvotes: 4

Hans Passant
Hans Passant

Reputation: 942010

Sign of a resource leak, window handles most likely. Diagnose with TaskMgr.exe, Processes tab. View + Select Columns and tick Handles, USER Objects and GDI Objects. Keep on eye on the values for your program while you are using it. A steady increase spells trouble, Windows stops giving more after 10,000.

If that doesn't help then improve your exception handling so you can get a better diagnostic, a stack trace is important to diagnose trouble like this.

Upvotes: 6

Related Questions