Groups | Blog | Home
all groups > dotnet compact framework > october 2007 >

dotnet compact framework : Restarting (relaunching) application



Jin Chang
10/30/2007 3:24:19 AM
Hi all,

I have a need to restart or relaunch the application from itself. The
first thing I tried is to modify the program.cs source so that the
Application.Run() is within a loop as so:

// ExitApplication is a static public variable
while (!ExitApplication)
{
Application.Run(new MainForm());
}

This approach doesn't seem to work (errors out).
Anyone have some other approach I could take?

Thanks.

- Jin
dbgrick
10/30/2007 6:32:01 AM
One possible solution would be to use CeRunAppAtATime to schedule your app to
start in a few seconds from the shut down time and then shut down your app.
Or you could create a small application that waits for your app to shutdown
and then starts your app then shut down your app and have the secondary app
restart the primary. You would use the Process Start method in C#.

Regards,
Rick D.
Contractor

[quoted text, click to view]
dbgrick
10/30/2007 6:22:01 PM
Perhaps you need to read the initial post.


[quoted text, click to view]
Grzegorz Makarewicz
10/31/2007 1:16:33 AM
[quoted text, click to view]

this is't question about run apllication@startup of PSPC in
wakeup(start), but how to relaunch (kill/start) C# application at failure :)

howto kill himelvs :
System.Diagnostics.Process.GetCurrentProcess().Kill();

mak
NetCF 2.0 - sp2 - all socket connections in accept state are closed, any
AddThis Social Bookmark Button