TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Anouar Boujemaa
NA
4
3.4k
No code execution before exit
Nov 9 2012 6:30 AM
Hi all,
I have an issue with a winform. I would like to exit the application using Environment.Exit(1). However when I use this approach the code before the exit code does not execute. Any thoughts? Here is my code. Just as a note, the code runs successfully if I leave out the Environement.Exit(1) code.
public void ShowForm(System.Windows.Forms.Form frm, string id)
{
frmMain=frm;
this.Show();
object empty = null;
axW.Navigate("http://localhost:2124/Studiebogservice/_Ankomst/LabelPrint.aspx?id=" + id, ref empty, ref empty, ref empty, ref empty);
for (; axW.ReadyState != SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE; )
{
System.Windows.Forms.Application.DoEvents();
}
axW.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, ref empty, ref empty);
Environment.Exit(1);
}
Reply
Answers (
2
)
Store procedure for desktop application
How To display web outlook mails in Asp.net Web page