473,322 Members | 1,403 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,322 software developers and data experts.

Application.Exit() not exiting...

I am having a curious problem...

When 'Application.Exit()' command is executed in my program it does not end.
I set a breakpoint in the 'Dispose' methid that never gets called (yes, I am
in Debug mode) - what gives... this is certianly strange bahavior. The code
that I am running is below, I added Stop statements to alert me when the
applicaiton.exit() fails to quit the app...
Anyone have any ideas - I'm stuck!
Private Sub CheckForExistingLog(ByVal strLog As String)
If System.IO.File.Exists(strLog) Then
Debug.WriteLine(strLog & " was found")
If FileLen(strLog) > 0 Then
Debug.WriteLine("some previous actions failed...")
Me.SetAction("")
Me.SetLblTo("")
Me.SetSource("")
Me.SetTarget("")
Me.SetInfo("This patch has already been applied" & vbNewLine
& "Click Close to exit")
Me.pgTotal.Value = Me.pgTotal.Maximum
Application.Exit()
Stop
Else
Debug.WriteLine("all previous actions completed successfully")
Me.SetAction("")
Me.SetLblTo("")
Me.SetSource("")
Me.SetTarget("")
Me.SetInfo("This patch has already been applied" & vbNewLine
& "Click Close to exit")
Me.pgTotal.Value = Me.pgTotal.Maximum
Application.Exit()
Stop
End If
Else
Debug.WriteLine(strLog & " was NOT found")
Me.CreateOutputDataSet(strLog)
End If
End Sub
Jan 18 '06 #1
5 2299
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in
message news:AC**********************************@microsof t.com...
I am having a curious problem...

When 'Application.Exit()' command is executed in my program it does not
end.
I set a breakpoint in the 'Dispose' methid that never gets called (yes, I
am
in Debug mode) - what gives... this is certianly strange bahavior. The
code
that I am running is below, I added Stop statements to alert me when the
applicaiton.exit() fails to quit the app...
Anyone have any ideas - I'm stuck!


I may be way off but... in VB6 (just poking around here), it doesn't matter
which command you use to end the app, the stack needs to "un-wind" itself.
That means all 'End Subs' need to run. If there's anything along the way
that would require a form to reload, VB6 will reload that form and the app
will never "die". IOW, that Stop you have should run every single time,
whether the Exit functionality works or not.... but, like I said, I may be
way off <g>

--
Ken Halter - MS-MVP-VB (visiting from VB6 world) - http://www.vbsight.com
Please keep all discussions in the groups..
Jan 18 '06 #2
Hzgt9b

Is this a windowforms or an ASPNet application?

Cor
Jan 19 '06 #3
windowForms

"Cor Ligthert [MVP]" wrote:
Hzgt9b

Is this a windowforms or an ASPNet application?

Cor

Jan 19 '06 #4
HZgt.

Sorry, I was thinking about another problem

AFAIK does the the application.exit as it is not in a "sub main". It does
nothing.

You can try "me.close" instead.

I hope this helps,

Cor
Jan 19 '06 #5
Ken,
Thanks for your thoughts... this seems to be moving in the right
direction... I see that all the code "downstream" of this sub runs regardless
of the app...exit()...

Looks like I'll have to use some if/then logic to detect if this sub
finished normally...
"Ken Halter" wrote:
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in
message news:AC**********************************@microsof t.com...
I am having a curious problem...

When 'Application.Exit()' command is executed in my program it does not
end.
I set a breakpoint in the 'Dispose' methid that never gets called (yes, I
am
in Debug mode) - what gives... this is certianly strange bahavior. The
code
that I am running is below, I added Stop statements to alert me when the
applicaiton.exit() fails to quit the app...
Anyone have any ideas - I'm stuck!


I may be way off but... in VB6 (just poking around here), it doesn't matter
which command you use to end the app, the stack needs to "un-wind" itself.
That means all 'End Subs' need to run. If there's anything along the way
that would require a form to reload, VB6 will reload that form and the app
will never "die". IOW, that Stop you have should run every single time,
whether the Exit functionality works or not.... but, like I said, I may be
way off <g>

--
Ken Halter - MS-MVP-VB (visiting from VB6 world) - http://www.vbsight.com
Please keep all discussions in the groups..

Jan 19 '06 #6

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

Similar topics

8
by: Andrew Warren | last post by:
I'm trying to exit a Windows Forms application while in the form's constructor (after InitializeComponent() has been called) and am finding that calling Application.Exit () still leaves the form...
5
by: cj | last post by:
Normally, a dotNET application will throw an exception when something goes wrong, and the exception can be caught easily and reported to the user. However, users have been reporting that our...
4
by: Dino M. Buljubasic | last post by:
I know this sounds ridiculous but I am having problems when exiting/sighing out of my application. I have two forms, Login and Main. On Main form, I have two buttons, Sign Out and Exit. These...
2
by: tt | last post by:
Hi, ANy ideas on this? When I click the close button of a window in VB.net which method gets called? I used Applicaton.exit in some method of my appln. to exit the application but, it still...
3
by: John Wildes | last post by:
Hello All I have an application that has one form. I start the application using a Application.Run(New frmMain) command in Sub Main(). When I exit, the exit menu Item simply does a Me.Close ....
20
by: Peter Oliphant | last post by:
How does one launch multiple forms in an application? Using Photoshop as an example, this application seems to be composed of many 'disjoint' forms. Yet, they all seem somewhat 'active' in...
4
by: Markus Stoeger | last post by:
Hi, I have a problem with Application.Run() when Windows is shutting down. Please have a look at the copy&paste example program below. The application has no forms. It has only got a notify...
6
by: Ant | last post by:
Hi all, I'm putting together a simple help module for my applications, using html files stored in the application directory somewhere. Basically it sets up a basic web server, and then uses the...
2
by: jrpfinch | last post by:
Is the following the most elegant way to exit a multi-threaded application on a Ctrl-C? I am a complete beginner and would have thought there was some way of doing it without having to use while...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...

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.