Click here to Skip to main content
15,917,795 members
Home / Discussions / C#
   

C#

 
GeneralRe: Need help in C# Pin
Judah Gabriel Himango23-Mar-05 9:00
sponsorJudah Gabriel Himango23-Mar-05 9:00 
GeneralInterface Problems Pin
Ox53746F6E6523-Mar-05 6:27
Ox53746F6E6523-Mar-05 6:27 
GeneralRe: Interface Problems Pin
leppie23-Mar-05 6:41
leppie23-Mar-05 6:41 
GeneralRe: Interface Problems Pin
Ox53746F6E6523-Mar-05 6:45
Ox53746F6E6523-Mar-05 6:45 
GeneralRe: Interface Problems Pin
J4amieC23-Mar-05 9:21
J4amieC23-Mar-05 9:21 
GeneralRe: Interface Problems Pin
Joel Lucsy23-Mar-05 7:10
Joel Lucsy23-Mar-05 7:10 
GeneralRe: Interface Problems Pin
Ox53746F6E6523-Mar-05 7:41
Ox53746F6E6523-Mar-05 7:41 
GeneralDispose Error Pin
JMichael246823-Mar-05 4:38
JMichael246823-Mar-05 4:38 
I am working on an app that uses a login form. The login form touches a database to validate the user. If the user chooses a cancel button on the login form a result flag is set to false and the login form closes. The main (calling) form tests the result and if it is false then the app should exit. That is where the following error occurs.

An unhandled exception of type 'System.ObjectDisposedException' occurred in system.windows.forms.dll

Additional information: Cannot access a disposed object named "frmMain".


Here is my code:



<br />
[STAThread]<br />
static void Main() <br />
{<br />
     Application.Run(new frmMain());<br />
}<br />
<br />
public frmMain()<br />
{<br />
     InitializeComponent();<br />
     this.Show();<br />
     frmLogin frm = new frmLogin();<br />
     frm.ShowDialog();<br />
     if (frm.LoginResult == false)<br />
	Application.Exit();<br />
}<br />

What causes this, and how do I fix it?
GeneralRe: Dispose Error Pin
mav.northwind23-Mar-05 6:04
mav.northwind23-Mar-05 6:04 
GeneralRe: Dispose Error Pin
JMichael246823-Mar-05 7:42
JMichael246823-Mar-05 7:42 
GeneralRe: Dispose Error Pin
mav.northwind23-Mar-05 19:10
mav.northwind23-Mar-05 19:10 
GeneralCreate table in access database Pin
webhay23-Mar-05 3:08
webhay23-Mar-05 3:08 
GeneralRe: Create table in access database Pin
mav.northwind23-Mar-05 6:14
mav.northwind23-Mar-05 6:14 
GeneralRe: Create table in access database Pin
webhay23-Mar-05 6:24
webhay23-Mar-05 6:24 
GeneralRe: Create table in access database Pin
mav.northwind23-Mar-05 19:37
mav.northwind23-Mar-05 19:37 
GeneralMultiThread reading from stream Pin
Snowjim23-Mar-05 2:55
Snowjim23-Mar-05 2:55 
GeneralRe: MultiThread reading from stream Pin
leppie23-Mar-05 3:28
leppie23-Mar-05 3:28 
GeneralRe: MultiThread reading from stream Pin
Snowjim23-Mar-05 4:02
Snowjim23-Mar-05 4:02 
GeneralRe: MultiThread reading from stream Pin
Dave Kreskowiak23-Mar-05 11:24
mveDave Kreskowiak23-Mar-05 11:24 
GeneralStreamWriter and non-unicode writing to file Pin
23-Mar-05 1:36
suss23-Mar-05 1:36 
GeneralRe: StreamWriter and non-unicode writing to file Pin
leppie23-Mar-05 3:31
leppie23-Mar-05 3:31 
GeneralConverting to Word Pin
Amir Jalaly23-Mar-05 0:27
Amir Jalaly23-Mar-05 0:27 
GeneralRe: Converting to Word Pin
Guinness4Strength23-Mar-05 8:23
Guinness4Strength23-Mar-05 8:23 
GeneralRe: Converting to Word Pin
Amir Jalaly24-Mar-05 20:21
Amir Jalaly24-Mar-05 20:21 
GeneralRe: Converting to Word Pin
Guinness4Strength25-Mar-05 3:42
Guinness4Strength25-Mar-05 3:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.