473,385 Members | 1,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Restarting an application - how?

I have a problem I can't find a solution for. I have given my users the
ability to
restart the application from the File menu. I don't know how to re-invoke the
sub main() in my .vb module -- in the sub main, I do the following:

Dim frmSignon As New frmSignon
frmSignon.ShowDialog()
Application.Run(New frmMain)

First, am I invoking my application properly (I call the frmSignon first,
and if that's
successful, I then run the main application screen) and second, how do I
re-invoke
the application from within the main screen? I tried:

Application.Exit
Dim frmSignon As New frmSignon
frmSignon.ShowDialog()
Application.Run(New frmMain)

which upset the program terribly and it crashed. Any help is appreciated.
I'm at a
loss on this.

TIA,

W
Jul 21 '05 #1
4 1376
Elp
On Tue, 1 Feb 2005 05:11:04 -0800, W Hoover wrote:
I have a problem I can't find a solution for. I have given my users the
ability to
restart the application from the File menu. I don't know how to re-invoke the
sub main() in my .vb module -- in the sub main, I do the following:


Do not reinvoke your main but instead use the Process class to simply
launch a second instance of your application. You will need to pass the
path of your application's executable which is Application.ExecutablePath.
Once you've done that, close the current isntance with Application.Exit
Jul 21 '05 #2
Elp --

Thank you - that sort of helps. I'm in the development environment at this
point and really need to exit and restart the app. I'm assuming I can't just
do this with application.rundialog()?

"Elp" wrote:
On Tue, 1 Feb 2005 05:11:04 -0800, W Hoover wrote:
I have a problem I can't find a solution for. I have given my users the
ability to
restart the application from the File menu. I don't know how to re-invoke the
sub main() in my .vb module -- in the sub main, I do the following:


Do not reinvoke your main but instead use the Process class to simply
launch a second instance of your application. You will need to pass the
path of your application's executable which is Application.ExecutablePath.
Once you've done that, close the current isntance with Application.Exit

Jul 21 '05 #3
Elp
On Tue, 1 Feb 2005 05:45:01 -0800, W Hoover wrote:
Elp --

Thank you - that sort of helps. I'm in the development environment at this
point and really need to exit and restart the app. I'm assuming I can't just
do this with application.rundialog()?


Mmm, sorry i don't really understand what you are trying to say. What do
you mean by "I'm in the development environment at this point and really
need to exit and restart the app"?

To clarify what i said in my previous post, whenever you want to start
again your application from your application itself, use this code:

System.Diagnostics.Process.Start(Application.Execu tablePath)

After having executed this line of code you should have 2 instances of your
application running. Now if you want to restart your application from the
application itself (that is, close the current instance and launch a new
one), use the line of code above to launch a new instance of your app and
then use this code to close the current instance:

Application.Exit()
Jul 21 '05 #4
Elp --

Thanks for your help and reply - I think I get it now.

Regards,

W

"Elp" wrote:
On Tue, 1 Feb 2005 05:45:01 -0800, W Hoover wrote:
Elp --

Thank you - that sort of helps. I'm in the development environment at this
point and really need to exit and restart the app. I'm assuming I can't just
do this with application.rundialog()?


Mmm, sorry i don't really understand what you are trying to say. What do
you mean by "I'm in the development environment at this point and really
need to exit and restart the app"?

To clarify what i said in my previous post, whenever you want to start
again your application from your application itself, use this code:

System.Diagnostics.Process.Start(Application.Execu tablePath)

After having executed this line of code you should have 2 instances of your
application running. Now if you want to restart your application from the
application itself (that is, close the current instance and launch a new
one), use the line of code above to launch a new instance of your app and
then use this code to close the current instance:

Application.Exit()

Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: serge | last post by:
We have an ASP application installed on one powerful Win 2003 and the SQL Server on another Win 2003. We have two copies of the application (identical, one for production and one for test...
0
by: LJ | last post by:
I have been getting this message and can't resolve the problem. I have checked the AntiVirus software and added the application directory to the exculsion list. The application is on a web farm,...
3
by: Jerry Boone | last post by:
I have a development unit running XP Pro and I cannot get it to build a web project without restarting IIS. There errors in the task list are.... ! Could not copy temporary files to the output...
4
by: Hari Koduru | last post by:
Hi All, I am getting the following exception in an ASP.NET application. Exception Details: System.InvalidOperationException: Application is restarting. I have been to the following Support...
7
by: John | last post by:
Hi Is there a way to restart a winform app in case of a serious error? Thanks Regards
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.