473,398 Members | 2,188 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,398 software developers and data experts.

WinApp: unhandled win32Exception on Application Exit

nev
251 100+
when i click the 'x' box of a form to exit i get the Error creating window handle.

but when i use my file menu exit menuitem which does...

Global.System.Windows.Forms.Application.Exit()

my program closes with no win32exception was unhandled.

what must i do to the 'x' exitbox to exit application successfully?

the 'x' i'm speaking of is the exit button beside the minimize & maximize button on the upper-right corner of a window.
Nov 23 '07 #1
6 2391
Shashi Sadasivan
1,435 Expert 1GB
Hi nev,
Please follow the genral rules (found in the FAQ section)while posting your questions at TSDN, especially on how to Use a Good Thread Title



Are you Overriding or handling the closing event of the form?
- Shashi
Nov 23 '07 #2
nev
251 100+
Hi nev,
Please follow the genral rules (found in the FAQ section)while posting your questions at TSDN, especially on how to Use a Good Thread Title



Are you Overriding or handling the closing event of the form?
- Shashi
oh sorry about that. truth is i didn't find time to read about that in the first place. i'll check it out. anyways...

i tried to place...

Global.System.Windows.Forms.Application.Exit()

in the...
1. form closing event 'didn't did the job
2. handledestroyed 'not either

on top of that, isn't clicking 'x' supposed to perform Global.System.Windows.Forms.Application.Exit()
Nov 23 '07 #3
Shashi Sadasivan
1,435 Expert 1GB
Only if the parent form is closed the Application.Exit is called.
For all other forms they are only closed.

I am not sure if this would cause an issue by putting it in the ormClosing event. Try the form Closed event

If this form is not the parent form then there i sno need to send that command from the closing / closed event
Nov 23 '07 #4
nev
251 100+
thank you. i'll try it.
Nov 23 '07 #5
nev
251 100+
its the mdiparent actually. it doesn't have a form closed/closing event. here's the situation, a childform is open in the mdiparent. i don't encounter this error before and now it happens when i close the mdi using the 'x'. so i was thinking since the code in my menuitem works, i might as well place it in my mdiparent exit event. the problem is the mdiparent has no exit event.
Nov 23 '07 #6
Shashi Sadasivan
1,435 Expert 1GB
what do you mean by the event does not exist?

Only if you create one will it exists.

if your application starts from the MDI Parent, then that form is the main thread.
any other forms opened are contained in seperate threads.

If any of the child forms/threads are closed the main thread is not affected (until you tell so).
if the MDI Parent is closed (which is the main thread) then all child threads / forms are closed along with it.

I do not know why exactly is that piece of code throwing errors, but it isint of much use.

Could you remove those events and try if it still gives any errors
Nov 23 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Professor Frink | last post by:
First off, I apologize if this gets long. I'm simply trying to give you all enough information to help me out. I'm writing (almost finished, actually), my first VB.Net application. It's a forms...
4
by: Craig831 | last post by:
First off, I apologize if this gets long. I'm simply trying to give you all enough information to help me out. I'm writing (almost finished, actually), my first VB.Net application. It's a forms...
5
by: Dave Stewart | last post by:
I recently wrote my first Vb.net application, or at least my first complex app since moving up from vb6. When run from the VS.NET IDE, the program shows no errors and runs fine. When the output exe...
0
by: mammucion | last post by:
Trying to automate processing 80,000 data sets through 15 web pages. Application URL creates a new IE instance in which runs first a login form and then runs the rest of the pages in the new...
0
by: Colmeister | last post by:
I recently read Jason Clark's excellent article on Unhandled Exceptions (http://msdn.microsoft.com/msdnmag/issues/04/06/NET/default.aspx) and have attempted to incorporate the features he talks...
1
by: kuhrty | last post by:
Hi, I am creating a multi-winform project. Everything has been working fine, except after I perform an update to the database and decide to Exit the winform after the update operation is...
4
by: bg_ie | last post by:
Hi, I have the following Program.cs - namespace TestFrameworkApplication { static class Program { /// <summary> /// The main entry point for the application.
1
by: aine_canby | last post by:
Hi, This is my Program class in my Application - static class Program { /// <summary> /// The main entry point for the application. /// </summary>
1
Shashi Sadasivan
by: Shashi Sadasivan | last post by:
Hi all, I have got my windows app to handled any UI or unhandled exceptions. following is the code static class Program { /// <summary> /// The main entry point for the...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.