Solved

Multithreading inDelphi

Posted on 2000-02-18
8
178 Views
Last Modified: 2010-04-04
How would you create threads say for scanning for a keypress and something else. I am working on a SCSI app and need to be able to test and interrupt the test at any time. The SRB_ABORT and SRB_EXEC need to run simultaneously. In other words, start reading a disk, then if I choose, press ESC and stop (SRB_ABORT). Right now, if I start a process (Reads, for example) the process locks me out until it completes, so I can not abort. Code snippets please.
0
Comment
Question by:evansj
8 Comments
 
LVL 5

Expert Comment

by:TheNeil
ID: 2535645
Try adding Application.ProcessMessages to your code at regular intervals (or in a loop if that's what you're using). You can then process key presses, set flags, and drop out if you need to. Far simpler than messing around with threads

The Neil
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2535677
Why not looking at the demo in delphi?

{$Delphi}\Demos\threads

Zif
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 200 total points
ID: 2535719
0
 

Expert Comment

by:niknoxe
ID: 2537697
If this hadn't helped you, let me know. Application.ProcessMessages brings you on the right way, but there is a lot more to get them responding!
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Expert Comment

by:bryan7
ID: 2539301
listenning
0
 

Author Comment

by:evansj
ID: 2554499
I'm also reissuing this question for TheNeil so he can get points also.
0
 
LVL 5

Expert Comment

by:TheNeil
ID: 2554587
Thanks for the points - don't know if I deserve but you won't hear any complaints (well not from me).

The Neil
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2555261
Thanks for the points - I only hope you have found what you need, because otherwise this was a waste of points. zif.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

910 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

18 Experts available now in Live!

Get 1:1 Help Now