|
-
Mar 19th, 2000, 01:55 AM
#1
Thread Starter
Member
Closing my program on shut down
Hi,
My program will not close when windows 98 se shuts down or restarts. It is a module, no forms running in the background. Every time I shut down or restart windows, it tells me it is not responding, and I have to close it. How do I make it close automatically? I have heard I have to subclass to get this done, but how??
Thanks,
Kevin
-
Mar 19th, 2000, 04:25 AM
#2
transcendental analytic
That have occured to me a lot. You just have to find the loop that is not terminated by ending the program. IE:
'-----------------code
Sub blablabla
.
Do
Doevents
.
.
Loop
.
end sub
-
Mar 19th, 2000, 09:31 AM
#3
Thread Starter
Member
Thanks,
I would really like my loop to end when my computer is shut down or restarted. How do I do this??
Thanks,
Kevin
-
Mar 19th, 2000, 04:58 PM
#4
transcendental analytic
I use to solve this problem by not doing any continous loop that never ends. But there is a way, it's a little complicated but it should work.
'CODE-------------------------------
'Declaration----------------------
Dim unloadnow As Byte
'The loop-------------------------
Private Sub Command1_Click()
Do
DoEvents
Loop Until unloadnow
unloadnow = 1
Unload Me
End Sub
'The unload section---------------
Private Sub Form_Unload(Cancel As Integer)
If unloadnow < 2 Then
unloadnow = 1
Cancel = 1
End If
End
End Sub
'------------------------------------
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
|