G
Guest
Hello, Newsgroupians:
I'm new to C#, and I'd like to ask for your input on a couple of questions
of mine.
First, I am creating a Windows application. In my main statement, I have
one line...
public static int Main(string[] astrArgs)
{
System.Windows.Forms.Application.Run(new QualWnd());
}
I the QualWnd() constructor, I have a try and catch statement. If I catch
the exception, I want the application to close, so in my exception I do the
following... this.Close(); However, an exception is raised when the
program control returns to Main(...). It indicates that it "cannot access a
disposed object," which I assume is my QualWnd.
What can I do to stop the program if my constructor of my form throws an
exception?
Second, I've purchased Charles Petzold's "Programming Windows with C#." I
think Mr. Petzold is an amazing author, especially his "Programming Windows,"
using Win32. As such, I bought his book, hoping it would be as informative.
However, "Programming Windows with C#" -- I believe -- is lacking his
traditional finesse and many technical details. It's only my opinion. Does
anyone have any other recommendations?
Thank you,
Trecius
I'm new to C#, and I'd like to ask for your input on a couple of questions
of mine.
First, I am creating a Windows application. In my main statement, I have
one line...
public static int Main(string[] astrArgs)
{
System.Windows.Forms.Application.Run(new QualWnd());
}
I the QualWnd() constructor, I have a try and catch statement. If I catch
the exception, I want the application to close, so in my exception I do the
following... this.Close(); However, an exception is raised when the
program control returns to Main(...). It indicates that it "cannot access a
disposed object," which I assume is my QualWnd.
What can I do to stop the program if my constructor of my form throws an
exception?
Second, I've purchased Charles Petzold's "Programming Windows with C#." I
think Mr. Petzold is an amazing author, especially his "Programming Windows,"
using Win32. As such, I bought his book, hoping it would be as informative.
However, "Programming Windows with C#" -- I believe -- is lacking his
traditional finesse and many technical details. It's only my opinion. Does
anyone have any other recommendations?
Thank you,
Trecius