Go to Post We've been thinking about just declaring our smallest kid on our BOM and making her part of the robot. - Qbot2640 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-02-2008, 12:30
FaNIX FaNIX is offline
Registered User
no team
 
Join Date: Feb 2008
Location: sa
Posts: 1
FaNIX is an unknown quantity at this point
Restarting Main Application in TThread Class

Hi People,

I am trying to restart my Main Application by using code inside a Thread. Basicly my restart function works 100% when placed inside the Main Application code. But since a TThread runs in another memory space, i think reference to the Application.Terminate is not set to the Main Application, maybe to the thread, I don't know.

Here is my restart procedure inside my Thread:

Quote:
procedure TUpdateLibThread.AppRestart;
var
HANDLE : HWND;
begin
ShellExecute(HANDLE,'open',Application.ExeName, '', '', 1) ;
Application.Terminate;
end;
The thread is called by die main application, but the restart application must be inside the thread, as the outcome of the thread determines if the application should be restarted or not. If there is a way to return a value back to the main application when the thread ends, then i might be able to use that to determine if i need to call the restart procedure...

Help?
  #2   Spotlight this post!  
Unread 01-02-2008, 12:34
EricH's Avatar
EricH EricH is offline
New year, new team
FRC #1197 (Torbots)
Team Role: Engineer
 
Join Date: Jan 2005
Rookie Year: 2003
Location: SoCal
Posts: 19,814
EricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond repute
Re: Restarting Main Application in TThread Class

If you are using the Delphi programming language, you might not find a lot of help here. Chief Delphi is a forum for discussing the FIRST Robotics Competition, whose main programming language is C. Some may know Delphi, but most will think of the automotive corporation. This thread may help you find a better location to ask your question.
__________________
Past teams:
2003-2007: FRC0330 BeachBots
2008: FRC1135 Shmoebotics
2012: FRC4046 Schroedinger's Dragons

"Rockets are tricky..."--Elon Musk

Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
changing main.c 3dude_2231 Programming 15 21-02-2007 01:54
main.c 6600gt Programming 3 29-08-2006 02:19
Editing Main.c Astronouth7303 Programming 22 20-02-2004 16:45
Main Stage archiver 2001 3 24-06-2002 03:06
main driver Kaitlin Palmer Off-Season Events 0 09-04-2002 21:26


All times are GMT -5. The time now is 19:14.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi