Click here to Skip to main content
16,017,788 members
Home / Discussions / C#
   

C#

 
GeneralRe: NaN for Integer... Pin
CPallini25-Jul-07 2:20
mveCPallini25-Jul-07 2:20 
AnswerRe: NaN for Integer... Pin
Brady Kelly25-Jul-07 2:32
Brady Kelly25-Jul-07 2:32 
JokeRe: NaN for Integer... Pin
Luc Pattyn25-Jul-07 7:21
sitebuilderLuc Pattyn25-Jul-07 7:21 
QuestionPDF to JPEG conversion ? Pin
adilkazmi25-Jul-07 1:38
adilkazmi25-Jul-07 1:38 
AnswerRe: PDF to JPEG conversion ? Pin
originSH25-Jul-07 1:42
originSH25-Jul-07 1:42 
AnswerRe: PDF to JPEG conversion ? Pin
adilkazmi25-Jul-07 1:55
adilkazmi25-Jul-07 1:55 
GeneralRe: PDF to JPEG conversion ? Pin
Pete O'Hanlon25-Jul-07 2:04
mvePete O'Hanlon25-Jul-07 2:04 
QuestionHow to safely Form.Invoke from another thread? [modified] Pin
michal.kreslik25-Jul-07 1:19
michal.kreslik25-Jul-07 1:19 
Hello,

how do I safely invoke a delegate on my windows form if I can't eliminate the possibility that the form gets disposed BETWEEN me checking whether it is disposed and the invoke code itself?

Randomly I'm getting an exception that says I can't access the disposed object. It's absolutely clear that I can't access a disposed object, but how do I make sure it's indeed NOT disposed if it can still get disposed right after I check whether it is disposed? Smile | :)

Consider this example that looks correct, but produces the above mentioned exception from time to time:

if (!MyForm.IsDisposed)
{
    // what if the form gets disposed BETWEEN the above line
    // of code and the following line of code?
    MyForm.Invoke(MyDelegate);
}


Form.Disposing doesn't help neither.

Thanks very much for any input,
Michal


-- modified at 7:24 Wednesday 25th July, 2007
AnswerRe: How to safely Form.Invoke from another thread? Pin
michal.kreslik25-Jul-07 1:44
michal.kreslik25-Jul-07 1:44 
AnswerRe: How to safely Form.Invoke from another thread? Pin
Tormod Fjeldskaar25-Jul-07 1:50
Tormod Fjeldskaar25-Jul-07 1:50 
GeneralRe: How to safely Form.Invoke from another thread? Pin
michal.kreslik25-Jul-07 2:47
michal.kreslik25-Jul-07 2:47 
GeneralRe: How to safely Form.Invoke from another thread? Pin
Luc Pattyn25-Jul-07 7:29
sitebuilderLuc Pattyn25-Jul-07 7:29 
GeneralRe: How to safely Form.Invoke from another thread? Pin
michal.kreslik25-Jul-07 11:41
michal.kreslik25-Jul-07 11:41 
GeneralRe: How to safely Form.Invoke from another thread? Pin
Luc Pattyn25-Jul-07 12:15
sitebuilderLuc Pattyn25-Jul-07 12:15 
GeneralRe: How to safely Form.Invoke from another thread? Pin
michal.kreslik25-Jul-07 21:43
michal.kreslik25-Jul-07 21:43 
GeneralRe: How to safely Form.Invoke from another thread? Pin
michal.kreslik25-Jul-07 23:13
michal.kreslik25-Jul-07 23:13 
QuestionGROUP BY RECORD IN GRIDVIEW & EXPORT TO EXCEL Pin
krishanpanda25-Jul-07 1:07
krishanpanda25-Jul-07 1:07 
QuestionNeed VSD for asp.net case study Pin
Banjo Ayorinde25-Jul-07 1:05
Banjo Ayorinde25-Jul-07 1:05 
AnswerRe: Need VSD for asp.net case study Pin
UglyxXXx25-Jul-07 23:25
UglyxXXx25-Jul-07 23:25 
QuestionDataGridView Pin
sangramkp25-Jul-07 0:48
sangramkp25-Jul-07 0:48 
AnswerRe: DataGridView Pin
Tormod Fjeldskaar25-Jul-07 1:00
Tormod Fjeldskaar25-Jul-07 1:00 
Questiondatagrid focus Pin
praveenkumar palla25-Jul-07 0:45
praveenkumar palla25-Jul-07 0:45 
AnswerRe: datagrid focus Pin
Nouman Bhatti25-Jul-07 2:46
Nouman Bhatti25-Jul-07 2:46 
QuestionHiding Form after loading another Pin
Banjo Ayorinde25-Jul-07 0:12
Banjo Ayorinde25-Jul-07 0:12 
AnswerRe: Hiding Form after loading another Pin
Eduard Keilholz25-Jul-07 0:21
Eduard Keilholz25-Jul-07 0:21 

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.