Click here to Skip to main content
16,015,658 members
Home / Discussions / C#
   

C#

 
QuestionInstall problem? Pin
Yulianto.23-Oct-04 16:51
Yulianto.23-Oct-04 16:51 
GeneralHelp please Pin
Yulianto.23-Oct-04 16:48
Yulianto.23-Oct-04 16:48 
GeneralRe: Help please Pin
Alex Korchemniy24-Oct-04 9:22
Alex Korchemniy24-Oct-04 9:22 
GeneralClone a copy of System.WIndows.Forms.Panel Pin
hoho_leung23-Oct-04 13:16
hoho_leung23-Oct-04 13:16 
GeneralRe: Clone a copy of System.WIndows.Forms.Panel Pin
Alex Korchemniy23-Oct-04 13:32
Alex Korchemniy23-Oct-04 13:32 
General.net style Pin
tom_dx23-Oct-04 11:35
tom_dx23-Oct-04 11:35 
GeneralRe: .net style Pin
Alex Korchemniy23-Oct-04 13:39
Alex Korchemniy23-Oct-04 13:39 
QuestionDisposing a form in another thread? Pin
Carl Mercier23-Oct-04 7:11
Carl Mercier23-Oct-04 7:11 
Hi,

I'm trying to close and dispose a form that is running in another process, but I get the error message "A first chance exception of type 'System.ObjectDisposedException' occurred in system.windows.forms.dll", "Additional information: Cannot access a disposed object named "frmProgressWindow".".

Here's what I'm trying to do basically...

My main UI thread launches another thread in which I show a modal Progress Window (form with a progress bar). When I'm done performing certain actions, I want to close the progress window from my main thread, so I call this code:

Private Sub CloseProgressWindow()<br />
  If _progressWindow Is Nothing Then Return<br />
  _progressWindow.Invoke(New CloseProgressWindowDelegate(AddressOf _progressWindow.Close))<br />
  _progressWindow.Invoke(New DisposeProgressWindowDelegate(AddressOf _progressWindow.Dispose))<br />
End Sub


The exception occurs on the "End Sub" (!) line. See the screenshot at http://www2.adonis.ca/disposeerror.png[^].

What am I doing wrong?

Thanks!

Carl

PS: I know the code is VB, and this is a C# forum, but I figured people in the VB forum wouldn't have enough knowledge for this question. Since I fully understand both languages, feel free to answer in C# Wink | ;)
AnswerRe: Disposing a form in another thread? Pin
Carl Mercier23-Oct-04 7:30
Carl Mercier23-Oct-04 7:30 
GeneralRe: Disposing a form in another thread? Pin
Dennis C. Dietrich23-Oct-04 9:19
Dennis C. Dietrich23-Oct-04 9:19 
QuestionHow to get absolute value of the pixel cordinates using mouse position Pin
Anonymous23-Oct-04 6:48
Anonymous23-Oct-04 6:48 
AnswerRe: How to get absolute value of the pixel cordinates using mouse position Pin
Alex Korchemniy23-Oct-04 12:33
Alex Korchemniy23-Oct-04 12:33 
GeneralRefresh DataGrid question Pin
markdbd23-Oct-04 6:21
markdbd23-Oct-04 6:21 
GeneralRe: Refresh DataGrid question Pin
Alex Korchemniy23-Oct-04 12:40
Alex Korchemniy23-Oct-04 12:40 
GeneralRe: Refresh DataGrid question Pin
markdbd24-Oct-04 2:13
markdbd24-Oct-04 2:13 
GeneralRe: Refresh DataGrid question Pin
Alex Korchemniy24-Oct-04 9:08
Alex Korchemniy24-Oct-04 9:08 
GeneralCalling an event Pin
Anonymous23-Oct-04 5:46
Anonymous23-Oct-04 5:46 
GeneralRe: Calling an event Pin
Alex Korchemniy23-Oct-04 13:21
Alex Korchemniy23-Oct-04 13:21 
GeneralThread.Abort hangs the calling thread in VS .NET 2005 Pin
Ami Bar23-Oct-04 5:10
Ami Bar23-Oct-04 5:10 
GeneralRe: Thread.Abort hangs the calling thread in VS .NET 2005 Pin
Dennis C. Dietrich23-Oct-04 9:36
Dennis C. Dietrich23-Oct-04 9:36 
GeneralmySQl Problem in C#. Suspect it's my mySQL config... Pin
Admiral Ackbar23-Oct-04 3:59
Admiral Ackbar23-Oct-04 3:59 
Questionis there a way?? Pin
tom_dx23-Oct-04 3:46
tom_dx23-Oct-04 3:46 
AnswerRe: is there a way?? Pin
Colin Angus Mackay23-Oct-04 4:14
Colin Angus Mackay23-Oct-04 4:14 
GeneralRe: is there a way?? Pin
tom_dx23-Oct-04 4:39
tom_dx23-Oct-04 4:39 
GeneralRe: is there a way?? Pin
Colin Angus Mackay23-Oct-04 4:41
Colin Angus Mackay23-Oct-04 4:41 

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.