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

C#

 
AnswerRe: Can't Break point ASP Project Pin
martin_hughes12-Oct-07 5:21
martin_hughes12-Oct-07 5:21 
GeneralRe: Can't Break point ASP Project Pin
smarttom9913-Oct-07 4:29
smarttom9913-Oct-07 4:29 
GeneralRe: Can't Break point ASP Project Pin
martin_hughes13-Oct-07 6:03
martin_hughes13-Oct-07 6:03 
QuestionModal Dialogs Pin
Skippums12-Oct-07 5:05
Skippums12-Oct-07 5:05 
AnswerRe: Modal Dialogs Pin
TJoe12-Oct-07 6:13
TJoe12-Oct-07 6:13 
GeneralRe: Modal Dialogs Pin
Skippums12-Oct-07 6:27
Skippums12-Oct-07 6:27 
GeneralRe: Modal Dialogs [modified] Pin
Fayu12-Oct-07 7:22
Fayu12-Oct-07 7:22 
QuestionRe: Modal Dialogs Pin
Skippums12-Oct-07 7:02
Skippums12-Oct-07 7:02 
OK. I have come up with a painful, yet operable, solution. In every single static "Show" method that could get called in my MessageBoxExtended class, I do the following...

public static DialogResult Show(IWin32Window owner, ...) {
Control parent = owner as Control;
if (parent != null && parent.InvokeRequired) {
return (DialogResult)parent.Invoke(new SpecificDelegate(MessageBoxExtended.Show),
new object[] { parent, ... });
} else {
return (new MessageBoxExtended(...)).ShowDialog(owner);
}
}

Every "..." in the previous (and following) code is filled in with identical arguments with what is passed in. This works, but I am confused why the following does not...

public static DialogResult Show(IWin32Window owner, ...) {
Control parent = owner as Control;
MessageBoxExtended mbe = new MessageBoxExtended(...);
if (parent != null && parent.InvokeRequired) {
return (DialogResult)parent.Invoke(new ShowDialogDelegate(mbe.ShowDialog),
new object[] { parent });
} else {
return (new MessageBoxExtended(...)).ShowDialog(owner);
}
}

Does anyone have any insight as to why the hell the first method works as expected but the second freezes?! My head feels like it is about to explode (and I am sad becuase I have to add like 50 delegates to my class)!

Jeff (More confused than I have ever been)
AnswerRe: Modal Dialogs Pin
Luc Pattyn12-Oct-07 7:20
sitebuilderLuc Pattyn12-Oct-07 7:20 
GeneralRe: Modal Dialogs Pin
Skippums12-Oct-07 7:59
Skippums12-Oct-07 7:59 
AnswerRe: Modal Dialogs Pin
Luc Pattyn12-Oct-07 7:53
sitebuilderLuc Pattyn12-Oct-07 7:53 
QuestionBase data Pin
RussBus12-Oct-07 4:51
RussBus12-Oct-07 4:51 
AnswerRe: Base data Pin
led mike12-Oct-07 4:57
led mike12-Oct-07 4:57 
GeneralRe: Base data Pin
RussBus12-Oct-07 5:02
RussBus12-Oct-07 5:02 
AnswerRe: Base data Pin
Skippums12-Oct-07 5:21
Skippums12-Oct-07 5:21 
GeneralRe: Base data Pin
RussBus12-Oct-07 5:43
RussBus12-Oct-07 5:43 
GeneralRe: Base data Pin
RussBus12-Oct-07 5:57
RussBus12-Oct-07 5:57 
GeneralRe: Base data Pin
Skippums12-Oct-07 5:58
Skippums12-Oct-07 5:58 
QuestionHow to count imgae files in a folder Pin
Member 46302412-Oct-07 4:50
Member 46302412-Oct-07 4:50 
AnswerRe: How to count imgae files in a folder Pin
led mike12-Oct-07 4:54
led mike12-Oct-07 4:54 
AnswerRe: How to count imgae files in a folder Pin
Jacky Yiu12-Oct-07 5:01
Jacky Yiu12-Oct-07 5:01 
GeneralRe: How to count imgae files in a folder Pin
Member 46302412-Oct-07 5:31
Member 46302412-Oct-07 5:31 
GeneralRe: How to count imgae files in a folder Pin
Jacky Yiu13-Oct-07 1:15
Jacky Yiu13-Oct-07 1:15 
GeneralRe: How to count imgae files in a folder Pin
Member 46302413-Oct-07 10:34
Member 46302413-Oct-07 10:34 
AnswerRe: How to count imgae files in a folder Pin
Anthony Mushrow12-Oct-07 5:02
professionalAnthony Mushrow12-Oct-07 5:02 

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.