Re: Quick Question on Application.Exit()
- From: "pvdg42" <pvdg42@xxxxxxxxxxxxxxxxx>
- Date: Tue, 29 Nov 2005 12:24:41 -0600
"Doug Handler" <dkhandler@xxxxxxxxx> wrote in message
news:O9Bzh8Q9FHA.1416@xxxxxxxxxxxxxxxxxxxxxxx
> In C# 2.0, w/ the Program.cs file, i noticed that the Application.Run(new
> appname()) is run twice. I have in my constructor to do a check for a
> settings file, and if it isn't found, the application exits. But the app
> doesn't exit, can someone tell me what i'm doing wrong?
>
> here's my code:
> if (filename == null)
>
> Application.Exit();
>
>
How sure are you that filename is really null? I ask because a quick test
using a String explicitly set to null allows Application.Exit() to be called
and results in the expected termination here.
Have you walked through the code in the debugger to see the value assigned
to filename?
Note also that "" appears not to be equivalent to null. If I assign: String
s = ""; then testing if(s == null) returns false.
--
Peter [MVP Visual Developer]
Jack of all trades, master of none.
.
- References:
- Quick Question on Application.Exit()
- From: Doug Handler
- Quick Question on Application.Exit()
- Prev by Date: Re: Build error in overloaded function
- Next by Date: MenuStrip funny in Application Desktop Toolbar when docked?
- Previous by thread: Re: Quick Question on Application.Exit()
- Next by thread: Re: Build error in overloaded function
- Index(es):
Relevant Pages
|