Click here to Skip to main content
15,886,795 members
Home / Discussions / C#
   

C#

 
GeneralRe: Uploading Images Pin
srt726-Jan-04 6:36
srt726-Jan-04 6:36 
GeneralRe: Uploading Images Pin
Mazdak26-Jan-04 6:52
Mazdak26-Jan-04 6:52 
Generalthreading in c# Pin
eman galal26-Jan-04 3:44
eman galal26-Jan-04 3:44 
GeneralRe: threading in c# Pin
Heath Stewart26-Jan-04 4:20
protectorHeath Stewart26-Jan-04 4:20 
GeneralExit from main Pin
thomasa26-Jan-04 3:08
thomasa26-Jan-04 3:08 
GeneralRe: Exit from main Pin
Heath Stewart26-Jan-04 3:13
protectorHeath Stewart26-Jan-04 3:13 
GeneralRe: Exit from main Pin
thomasa26-Jan-04 3:49
thomasa26-Jan-04 3:49 
GeneralRe: Exit from main Pin
Heath Stewart26-Jan-04 4:08
protectorHeath Stewart26-Jan-04 4:08 
You can't call it in the constructor, either. You should read about Windows Forms programming in the .NET Framework SDK. Some previous experience with Win32 and the Windows Management APIs would be helpful with understanding the message pump. In this case, however, the application pump hasn't started. See the line:
Application.Run(new FCMain());
This is actually broken down to something similar to the following when compiled:
FCMain form = new FCMain();
Application.Run(form);
Therefore, you should throw an exception from your constructor and handle put a try/catch around the statement above. This will not, however, catch other exceptions unless a SystemException is thrown that causes the main form to crash and returns execution to the entry point.

A better design, however, is to move whatever code causes the need to exit out of the FCMain form's constructor and put it in the entry point (or a method that the entry point calls).

 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
Questionhacked? Pin
Anonymous26-Jan-04 2:47
Anonymous26-Jan-04 2:47 
AnswerRe: hacked? Pin
Thesisus26-Jan-04 3:05
Thesisus26-Jan-04 3:05 
GeneralRe: hacked? Pin
Heath Stewart26-Jan-04 3:10
protectorHeath Stewart26-Jan-04 3:10 
GeneralRe: hacked? Pin
Anonymous31-Jan-04 1:16
Anonymous31-Jan-04 1:16 
GeneralParentForm and a null reference Pin
Andrew McLellan26-Jan-04 1:47
Andrew McLellan26-Jan-04 1:47 
GeneralRe: ParentForm and a null reference Pin
Broken God26-Jan-04 2:06
Broken God26-Jan-04 2:06 
GeneralRe: ParentForm and a null reference Pin
AWoodgate26-Jan-04 6:23
AWoodgate26-Jan-04 6:23 
GeneralRe: ParentForm and a null reference Pin
Broken God27-Jan-04 8:32
Broken God27-Jan-04 8:32 
General.NET Serialization and versioning Pin
dabs26-Jan-04 1:04
dabs26-Jan-04 1:04 
GeneralRe: .NET Serialization and versioning Pin
Heath Stewart26-Jan-04 2:18
protectorHeath Stewart26-Jan-04 2:18 
GeneralGDI+ Problem Pin
occcy26-Jan-04 0:02
occcy26-Jan-04 0:02 
GeneralRe: GDI+ Problem Pin
Broken God26-Jan-04 2:10
Broken God26-Jan-04 2:10 
GeneralRe: GDI+ Problem Pin
occcy26-Jan-04 2:13
occcy26-Jan-04 2:13 
GeneralRe: GDI+ Problem Pin
Heath Stewart26-Jan-04 3:04
protectorHeath Stewart26-Jan-04 3:04 
GeneralRe: GDI+ Problem Pin
Heath Stewart26-Jan-04 3:09
protectorHeath Stewart26-Jan-04 3:09 
GeneralRe: GDI+ Problem Pin
leppie26-Jan-04 6:06
leppie26-Jan-04 6:06 
GeneralSharing process resources Pin
Jucovschi Petru25-Jan-04 22:57
Jucovschi Petru25-Jan-04 22:57 

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.