472,802 Members | 1,341 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,802 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 2359
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: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{

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.