|
-
September 17th, 2007, 05:10 AM
#1
Main Method, Threading & GUIs
Good Morning Folks,
I am an experienced programmer in a handful of languages, however I have no experience in C# (little in C, but only an introduction course at Uni). At the moment my main development language is Java, so I'm trying to understand how to use familiar concepts in C#. I am using Visual C# as part of Visual Studio Pro 2005.
The Problem
At the moment I cannot seem to create application that does not instantiate a GUI from the main method. When I create a new project in VS it gives me a Form1, and the main method uses Application.Run to instantiate.
However, I would *NEVER* drive the core processing of an application from a GUI in JAVA (or any other language, for that matter). So I want to create a class, called Core, which performs the bulk of computation. The GUI thread will then use the methods of Core.
(Core will also eventally include networking, DB access, etc. methods)
I have the generated Program.cs, which I would like to instantiate Core within the main method. During the instantiation of Core, it would then instantiate Form1.
The idea is that the process will not terminate because the process for Form1 is still running. However when I debug the application it launches Form1 (for a split second) before I get the console message "The program '[3476] WindowsApplication1.vshost.exe: Managed' has exited with code 0 (0x0)."
Any thoughts? Many Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|