I have MDI and Child Forms. My MDI_FormClosing event contains the following code:
clsMain.CN.Close();
clsMain.CN.Dispose();
Environment.Exit(-1);
When I closed the MDI form with no opened child forms, it was working well.
When I try to close MDI and there is a child form is opened, the following exception is thrown.
http://www.mediafire.com/conv/e039f1817d1719f47d55f3a1270ebad95741c775c40d4c36c500422dab7c09d86g.jpg
Problem signature:
Problem Event Name: APPCRASH
Application Name: General Accounts.vshost.exe
Application Version: 10.0.30319.1
Application Timestamp: 4ba2084b
Fault Module Name: ntdll.dll
Fault Module Version: 6.1.7600.16385
Fault Module Timestamp: 4a5bdadb
Exception Code: c0000005
Exception Offset: 00024b7d
OS Version: 6.1.7600.2.0.0.256.1
Locale ID: 3073
Additional Information 1: e8ad
Additional Information 2: e8adce1c2b9e7be834b4063ac3c53863
Additional Information 3: e8ad
Additional Information 4: e8adce1c2b9e7be834b4063ac3c53863
Read our privacy statement online:
http:
If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt
I tried to go to Project Properties, Debug tab and remove the check from "Enable the visual studio hosting process" .. it is still not working.
How can I avoid this message or this error ??