Click here to Skip to main content
16,005,491 members
Home / Discussions / C#
   

C#

 
GeneralRe: List definition in C# Pin
Stefan Troschuetz8-Jul-05 9:38
Stefan Troschuetz8-Jul-05 9:38 
GeneralRe: List definition in C# Pin
zaboboa8-Jul-05 9:41
zaboboa8-Jul-05 9:41 
GeneralRe: List definition in C# Pin
Stefan Troschuetz8-Jul-05 10:03
Stefan Troschuetz8-Jul-05 10:03 
GeneralRe: List definition in C# Pin
Snowblind379-Jul-05 8:01
Snowblind379-Jul-05 8:01 
GeneralSearch & replacing values in Xml Pin
breen258-Jul-05 9:05
breen258-Jul-05 9:05 
GeneralMDI child can't close itself Pin
Luis Alonso Ramos8-Jul-05 9:00
Luis Alonso Ramos8-Jul-05 9:00 
GeneralRe: MDI child can't close itself Pin
Snowblind379-Jul-05 8:24
Snowblind379-Jul-05 8:24 
GeneralRe: MDI child can't close itself Pin
Luis Alonso Ramos9-Jul-05 9:54
Luis Alonso Ramos9-Jul-05 9:54 
I've solved it. I already had a timer firing every 1/4 of a second, so I just set a flag mustClose to true, and in the timer the form closes itself. And it works fine.

But I still have the doubt on why it didn't work.

Snowblind37 wrote:
What other signal flow might be trying to run? I would find this out before anything. Do you have an infinate loop going on somewhere? A reference to a method that is waiting for information?

No. Nothing else. Basically on the Validated event, if it finds a duplicate asks on how to proceed (in a modal form) and if user chooses to work on the duplicate, Close() is called before returning from the event handler.

Snowblind37 wrote:
The NullReferenceException is likely because it hasn't reached the OnClosing handler

It's after the OnClosing. I've verified it in the debugger, and the exception only happens if I set e.Cancel to false in the OnClosing handler (which misteriously is set to true.)

Snowblind37 wrote:
Does the code even reach your this.Close().

Yes, and from there it goes to the OnClosing handler, with e.Cancel set to true (it's not a base class where a derived class could set it before.)

Snowblind37 wrote:
Not a bad idea to print out statements all the way through the flow and see where it crashes

I've stepped through all my code in the debugger. The crash is only when I try to set e.Cancel = false in the OnClosing handler, and it occurs after my handler returns, somewhere in the middle of the framework code.

When I have some time, I'll try to reproduce it in a simpler program.

Thanks for your comments!

-- LuisR



Luis Alonso Ramos
Intelectix - Chihuahua, Mexico

Not much here: My CP Blog!

GeneralRe: MDI child can't close itself Pin
Snowblind379-Jul-05 11:20
Snowblind379-Jul-05 11:20 
Questionbest way to connect to a database? Pin
Jassim Rahma8-Jul-05 7:32
Jassim Rahma8-Jul-05 7:32 
AnswerRe: best way to connect to a database? Pin
breen258-Jul-05 8:47
breen258-Jul-05 8:47 
GeneralSimple Instance Error Msg Pin
zaboboa8-Jul-05 5:32
zaboboa8-Jul-05 5:32 
GeneralRe: Simple Instance Error Msg Pin
Dave Kreskowiak8-Jul-05 5:42
mveDave Kreskowiak8-Jul-05 5:42 
GeneralRe: Simple Instance Error Msg Pin
Stefan Troschuetz8-Jul-05 5:51
Stefan Troschuetz8-Jul-05 5:51 
GeneralRe: Simple Instance Error Msg Pin
zaboboa8-Jul-05 6:14
zaboboa8-Jul-05 6:14 
GeneralRe: Simple Instance Error Msg Pin
Stefan Troschuetz8-Jul-05 9:40
Stefan Troschuetz8-Jul-05 9:40 
GeneralObject Inheritance Pin
heistgonewrong8-Jul-05 4:48
heistgonewrong8-Jul-05 4:48 
GeneralRe: Object Inheritance Pin
therealmccoy8-Jul-05 5:33
therealmccoy8-Jul-05 5:33 
GeneralRe: Object Inheritance Pin
S. Senthil Kumar8-Jul-05 5:46
S. Senthil Kumar8-Jul-05 5:46 
GeneralOut of Memory when I Drawing Pin
Alex Cutovoi8-Jul-05 4:21
Alex Cutovoi8-Jul-05 4:21 
GeneralRe: Out of Memory when I Drawing Pin
leppie8-Jul-05 4:24
leppie8-Jul-05 4:24 
GeneralRe: Out of Memory when I Drawing Pin
Alex Cutovoi8-Jul-05 6:42
Alex Cutovoi8-Jul-05 6:42 
GeneralRe: Out of Memory when I Drawing Pin
leppie8-Jul-05 6:50
leppie8-Jul-05 6:50 
GeneralRe: Out of Memory when I Drawing Pin
Alex Cutovoi8-Jul-05 9:54
Alex Cutovoi8-Jul-05 9:54 
GeneralRe: Out of Memory when I Drawing Pin
Guffa8-Jul-05 10:41
Guffa8-Jul-05 10: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.