Questions tagged [tthread]

92 questions
3
votes
1 answer

Does a finished Execute() function set the Terminated property

Since C++ Builder 2010 does not seem to include the CheckTerminated() function on TThread I added my own to a thread I needed to check the status of from outside the thread. This works fine, but I'm trying to find information as to whether or not…
inquam
  • 12,664
  • 15
  • 61
  • 101
3
votes
1 answer

Synchronizing Thread for image processing Delphi

I must processing one image in main form , but the processing speed is low for inc speed i use thread... My thread code : type TPaintThread = class(TThread) Source,Mask :TBitmap ; image : TImage; public procedure…
A1Gard
  • 4,070
  • 4
  • 31
  • 55
2
votes
0 answers

multi-threading thread safety

I am using Delphi TThread to run multiple TCP connections to external devices. Incoming data is dissected and stored. Everything works OK but on reviewing my code I am having doubts whether it is thread safe or if I am just being lucky so far... In…
2
votes
1 answer

Waiting for a TThread to finish with WaitForSingleObject()

I am creating a thread, and then say want to wait for it to terminate with a WFSO call (simplified pseudo-code below, obviously no one wants to wait on a thread right after creating it). constructor TFileScannerThread.Create(Parameters) begin ///…
Nani
  • 113
  • 5
2
votes
4 answers

Pausing execution of a Thread WITHOUT sleeping?

I am using the Skype API, which sends back a message everytime it receives one. I am not sure if this really is what is causing it, but it's the closest I can get: When I send too many messages, the COM control can't handle all the replies, which…
Jeff
  • 12,085
  • 12
  • 82
  • 152
2
votes
1 answer

Thread not executing on open non-modal form

Below is part of the code for a 'progress' form. Apart from ProgressBars (removed from code) it has a TLabel (LblDots) of which I want to change the caption (number of dots increasing). In the FormShow/FormClose the TDotterThread gets created and…
Jan Doggen
  • 8,799
  • 13
  • 70
  • 144
2
votes
1 answer

Free Pascal 2.6.2 error with TThread constructor

The Free Pascal 2.6.2 compiler (using Delphi mode) complained about program project16416258; {$mode Delphi} uses Classes; type TFPCTestThread = class(TThread) public constructor Create(CreateSuspended: Boolean); end; constructor…
mjn
  • 36,362
  • 28
  • 176
  • 378
2
votes
1 answer

C++ application causing Windows Handle leakage using multiple TClientSocket instances

I have come across an apparent handle leakage using the Borland/Embarcadero TClientSocket component. I have an application that creates multiple TThread instances, each of which creates a TClientSocket object dynamically, connects to its target…
mathematician1975
  • 21,161
  • 6
  • 59
  • 101
2
votes
4 answers

Start Communication from server first in delphi by Indy 10

In Socket applications programmed by TCPServer/Client components, usually we active server side, then connect client to server, and when we need to get or send data from one side to other, first we send a command from client to server and a…
Farshad H.
  • 303
  • 4
  • 16
2
votes
1 answer

how to let the TThread to keep working in background and showing me the result in a Listbox?

I have to develop a program to keep watching values in databases based on a Select statement given by me the watched values can be changed at anytime and my program must sense the changes based on a result of the select statement which is given by…
user1512094
  • 611
  • 2
  • 10
  • 23
1
vote
2 answers

TThread Access Violating on Terminate/Free

I am running a short bit of code that will occasionally (very rarely) Access Violate on the Terminate/Free of my TThread. I am running many instances of these threads but this spot seems to be the only ones that is causing problems and it only does…
user912447
  • 696
  • 1
  • 11
  • 31
1
vote
2 answers

How to get a result from an Anonymous Thread?

Basically, what I need to do is this: Show the user a "Please wait ..." form (lets call it waitForm) on top of the main form, execute http methods (get and post), and close the waitForm after I get the http response. Since the http post method…
q1werty
  • 25
  • 7
1
vote
1 answer

Threaded Excel File Processing in Delphi

I created a TThread to handle some critical issues in an Excel file, however, I'm currently experiencing some challenges as the thread doesn't seem to be working in parallel with my application. Despite my best efforts to identify the root cause of…
Issam
  • 133
  • 8
1
vote
1 answer

TThread blocks Form thread

This is absolutely basic code for testing purpose. And I can't find out why after clicking the button the new thread is blocking the GUI ( Main thread). Is there any reason for this behavior to happen? I'm sorry for silly question, but I've spend…
Gbr
  • 29
  • 6
1
vote
1 answer

TThread.OnTerminate executing thread

The Delphi help for TThread.OnTerminate states that: The method assigned to the OnTerminate event is executed in the context of the main thread rather than the context of the thread being terminated. Is this even the case when the thread is…
Wolfgang Bures
  • 509
  • 4
  • 12