|
-
Jan 5th, 2009, 02:31 AM
#1
Thread Starter
Junior Member
[RESOLVED] Which Startup Object To Use?
Howdy,
First off, I'm a bit of a newbie so patience is appreciated... I have a couple question about setting the startup object for a project that I'm working on, which so far has the following two components: (in addition to a few other various classes)
- Main Form, which contains a single user interface window, a Timer subroutine which comprises the main section of code for the form, and a bunch of event handlers.
- Main module, which declares a number of public variables, has several functions and subs that are mostly private, and has a Sub Main that carries out most of the program startup, setup of some threading, etc.
I think I'd like the Sub Main to be the startup object, but the program is primarily event driven and when Sub Main finishes executing the program exits. Right now I have a msgbox at the end of Sub Main, which is a temporary fix. With the msgbox open, the Timer subroutine and threads continues to do what they're supposed to, and everything works fine except the focus switches from the Main Form to the msgbox (although the form is mostly for display anyway, and all the display items continue to function). When the msgbox is acknowledged, the program exits. Is there some other way to pause execution at the end of Sub Main while still allowing the everything else in the thread to work (like the msgbox does?)
When I use the Main Form as the startup object, the program doesn't automatically exit (which is good), but then all the declarations in Sub Main are missed, and I haven't figured out how to placed them in the Main Form class so that everything still works (I dunno... maybe some re-definition of namespace might solve that?)
Hopefully that sufficiently explains my dilemma. In short, I have no clear idea of which way to go with the startup object.
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
|