|
-
Mar 20th, 2000, 05:55 AM
#1
Thread Starter
Member
Hi,
What is the sub unload called in a module. I know to load stuff you use sub Main(), but what about on unnload of a module??
Thanks,
Kevin
-
Mar 20th, 2000, 07:35 AM
#2
Frenzied Member
I don't think there is one, Modules are only really there to store code. They're a throwback from the days of linear programming(when programs started at the start and kept going until there was nothin else to do) The sub main is still there so VB knows where to start the module when the program is run and you don't have a startup object, say if you want to make some decisions about which forms to load first before you load them eg if you write a screen saver.
I don't know exactly what you're trying to do so I cant help but you shouldn't have a module running most of your code, it eats processor time.
-
Mar 20th, 2000, 08:16 AM
#3
Thread Starter
Member
Sam...
Thanks,
What I am trying to do is run a program in the background or invisible. I started out with a form but it waould not execute my code, when it was invisible. So, I was told if I ran it in a module it would work and it did. Except for when I tried to shut down windows with it running. It would not close, windows said uit was not responding. So, I asked around and was told that I could subclass to make my program close when windows sends it a messaage to close. But I don;t know how to do this.
Thanks,
Kevin
-
Mar 20th, 2000, 07:26 PM
#4
transcendental analytic
Well, here we go again. People seems to have this problem a lot. If you have a loop that contains at least one "doevents", you can't close you app while it is in that loop. That means if you have a loop that does not end you have to make it do that when you close it or else it won't. And thats really hard to do if you don't have any Unload events that can tell it to do so. SO i really recommend you to have at least one form in you app.
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
|