Solved

How do I create a UserInterface thread in Delphi?

Posted on 1999-01-06
4
254 Views
Last Modified: 2010-04-04
Is it possible to make one using TThread object ?

I tried to create a form in Execute function of Thread but it doesn't return from the constructor. Please help me out...
0
Comment
Question by:rjagan
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
bcrotaz earned 30 total points
ID: 1354838
I think you'll find you can't.
The VCL is not thread-safe.  Therefore you can't create a form in a thread, because it would call methods on the Application variable, which would be accessed from other threads too.

The best way out of this is to leave your user interface in the main VCL thread, and do all your intensive processing in other threads.  Then to display results from a thread, use the TThread.Synchronize(MyMethod) method.  There's some good help on this method.

Bryan
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1354839
Bryan is right. I really HATE it that the VCL is not thread safe...  :-(
0
 

Author Comment

by:rjagan
ID: 1354840
Thanks a lot for ur consideration
0
 

Author Comment

by:rjagan
ID: 1354841
Thanks a lot for ur consideration
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now