Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7820577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:20:52+00:00 2026-06-02T07:20:52+00:00

I have a Delphi7 Project with about 10 windows. The MainWindow gets loaded when

  • 0

I have a Delphi7 Project with about 10 windows. The MainWindow gets loaded when the program starts. After a while, the MainWindow accesses another window of the project to add listview items and updates them about ever 1-2 seconds. However this window seems to freeze and doesn’t show the listview at all after I opened it.

It works if I have in the OnShow Procedure of my MainWindow the following commands:

SecondWindow.Show;
SecondWindow.Close;

It works without problems but it seems unprofessional. Any Ideas how I could draw the window without getting showed?

EDIT: CODE (I use Indy9)

procedure TMainWindow.ServerSocketExecute(AThread: TIdPeerThread);
begin
 /....
 if Buffer = 'additem' then begin
    Window2.ListView1.Items.Add;
    Exit;
    // .....
 end;
end;

That’s it. I removed all the timers off Window2 and it seems still to freeze.
Either the mainWindow freezes instantly if an items gets added or when I try to open the 2nd Windows for the first time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T07:20:53+00:00Added an answer on June 2, 2026 at 7:20 am

    Your problem is that you are calling VCL methods from outside the main GUI thread, i.e. in TMainWindow.ServerSocketExecute. This event executes in a worker thread. Calling VCL/GUI code from a worker thread is simply against the rules of the game. All VCL code must execute in the main GUI thread.

    So, solve the problem by making sure that all VCL/GUI code executes in the GUI thread. Use the TIdPeerThread.Synchronize() method, or the TIdSync or TIdNotify class to achieve this.

    Thanks to @Remy for supplying the details that I did not know.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Delphi project and the main form is a child window of
I have a project in Delphi7. Its is rather large consisting of 40 odd
I have a problem with the background compiler in Delphi7: in my project there
I have ported our project from Delphi 7 to Delphi 2010. After adding some
My Delphi7 project will not run on my clients computer if i don't have
I have a Delphi (2007) project which, when I opened it, gave a very
In my Delphi Project i want to have a 'Settings' button that when clicked,
I have multiple rave reports(projects) in the project(the delphi project) and I want to
I have just started a new project, and I am using the Delphi 2009
I have had Delphi 2007 for a while. I tried the Delphi 2009 trial.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.