Board index » Visual Studio » End Program ends VB

End Program ends VB

Visual Studio334
Suddenly when I run a program in IDE, then press the End button on the task

bar it not only "End" the program execution, but ends VB itself, returning

me to Windows. This just started yesterday. Is there some setting from

within the IDE that I could have triggered that would cause this?



Thanks.



Marv


-
 

Re:End Program ends VB



"Marv Wade" <NG@columbus.rr.com>wrote in message

Quote
Suddenly when I run a program in IDE, then press the End button on the

task bar it not only "End" the program execution, but ends VB itself,

returning me to Windows. This just started yesterday. Is there some

setting from within the IDE that I could have triggered that would cause

this?



Thanks.



Marv



Do you use subclassing or similar techniques (like callback procedures using

WinAPI) in the project?



Dmitriy.





-

Re:End Program ends VB



"Marv Wade" <NG@columbus.rr.com>wrote in message

Quote
Suddenly when I run a program in IDE, then press the End button on the

task bar it not only "End" the program execution, but ends VB itself,

returning me to Windows. This just started yesterday. Is there some

setting from within the IDE that I could have triggered that would cause

this?



No such setting. Most likely, you've modified your program and now

terminating it abnormally is causing problems.



Basically, just don't end your program that way. End it "normally".

Clicking the End toolbar button is the same as using the End statement in

code and has the same (or worse) consequences.



You might even want to remove the End toolbar button. I'd leave it on the

Run menu though JUST IN CASE you get into a spot where you MUST end your app

this way.



--

Mike

Microsoft MVP Visual Basic





-

Re:End Program ends VB

"MikeD" <nobody@nowhere.edu>wrote in message

Quote
No such setting. Most likely, you've modified your program and now

terminating it abnormally is causing problems.



Basically, just don't end your program that way. End it "normally".

Clicking the End toolbar button is the same as using the End statement in

code and has the same (or worse) consequences.



I've been pushing that end button for years and am still yet to see any of

these consequences you talk about. VB is very good at cleaning up open

resources when the end button is pushed.



Marv,



If you can't use the end button something is wrong and needs to be fixed. As

Dmitriy said it's possible you're using some advanced techniques such as

subclassing.



Michael





-

Re:End Program ends VB

You are on the right track. This only occurs in one program. I recently

added a class that allows expanded tool tips to the program, although it is

one I have used in other programs, and in thinking back it did start to

occur after that. I didn't connect the two things. I'll need to remove

this class and see if it still occurs.



Thanks all for the input.



Marv





"Dmitriy Antonov" <antonovdima@netzero.net_NOT_FOR_SPAM>wrote in message

Quote


"Marv Wade" <NG@columbus.rr.com>wrote in message

news:e6AMpUyuGHA.5056@TK2MSFTNGP06.phx.gbl...

>Suddenly when I run a program in IDE, then press the End button on the

>task bar it not only "End" the program execution, but ends VB itself,

>returning me to Windows. This just started yesterday. Is there some

>setting from within the IDE that I could have triggered that would cause

>this?

>

>Thanks.

>

>Marv

>

Do you use subclassing or similar techniques (like callback procedures

using WinAPI) in the project?



Dmitriy.







-

Re:End Program ends VB

"Marv Wade" <NG@columbus.rr.com>wrote in message

Quote
You are on the right track. This only occurs in one program. I recently

added a class that allows expanded tool tips to the program, although it

is one I have used in other programs, and in thinking back it did start to

occur after that. I didn't connect the two things. I'll need to remove

this class and see if it still occurs.



It is possible to subclass and push the end button without crashes as long

as the subclassing code is in a seperate compiled ocx or dll. You can even

push the end button inside the callbacks without problems.



Michael





-

Re:End Program ends VB

"Marv Wade" <NG@columbus.rr.com>wrote in message

Quote
You are on the right track. This only occurs in one program. I recently

added a class that allows expanded tool tips to the program, although it

is one I have used in other programs, and in thinking back it did start to

occur after that. I didn't connect the two things. I'll need to remove

this class and see if it still occurs.



Thanks all for the input.



Marv



You could use IsInIDE function below to test if your program is running from

the IDE and disable subclassing in case you are done with it and want to

work with other areas in the program:



vbnet.mvps.org/code/core/isinide.htm">vbnet.mvps.org/code/core/isinide.htm





-

Re:End Program ends VB

Run some demo that uses subclassing from a bas module, then hit end when

subclassed. Boom.



--



Randy Birch

MS MVP Visual Basic

vbnet.mvps.org/">vbnet.mvps.org/



Please reply to the newsgroups so all can participate.









"Michael C" <nospam@nospam.com>wrote in message

"MikeD" <nobody@nowhere.edu>wrote in message

Quote
No such setting. Most likely, you've modified your program and now

terminating it abnormally is causing problems.



Basically, just don't end your program that way. End it "normally".

Clicking the End toolbar button is the same as using the End statement in

code and has the same (or worse) consequences.



I've been pushing that end button for years and am still yet to see any of

these consequences you talk about. VB is very good at cleaning up open

resources when the end button is pushed.



Marv,



If you can't use the end button something is wrong and needs to be fixed. As

Dmitriy said it's possible you're using some advanced techniques such as

subclassing.



Michael





-

Re:End Program ends VB

"Randy Birch" <rgb_removethis@mvps.org>wrote in message

Quote
Run some demo that uses subclassing from a bas module, then hit end when

subclassed. Boom.



I use extensive subclassing in almost every form of my app and get no

problems at all. The subclassing code is compiled into an ocx. Because of

this subclassing directly in the exe is a *really* bad idea.



Michael





-