|
-
Oct 30th, 2002, 03:31 PM
#1
Thread Starter
New Member
Killing Program [Sort of resolved, anything better?]
I am building a program that has the ability to update itself by checking the current version of itself with an internet appserver, and then opening an OLE automated version of internet explorer in a new window before shutting itself down so the update can proceed.
Unfortunately, the program can't be unloaded because after the forms are all unloaded when control is returned from the Class Module, the forms refuse to close and remain open.
Is there any way to forcibly terminate the app? Thanks for the help.
Last edited by AngelOfDeath69; Nov 3rd, 2002 at 09:15 PM.
-
Oct 30th, 2002, 03:35 PM
#2
Hyperactive Member
Well you can do it the noncomplicated way.
VB Code:
Private Sub Form_Unload() '<--It is an event yes, but it does not do its "cause" very well.
Unload Me
Unload frmYourForm1
Unload frmYourForm2
'Unload Blah Blah.
End Sub
53323737 15 743 313402 05 740313063. 17 15 4150 743 313402 05 140393403437 5203 743 30210.

-
Oct 30th, 2002, 03:39 PM
#3
Thread Starter
New Member
Doesn't Work
Well, interesting (and predictable) suggestion, but I forgot to mention that after asking the forms to unload they reload themselves.
This generally means that there is no way to do use the unload method on all the forms to quit the program. Sorry, I forgot to mention that!
-
Oct 30th, 2002, 03:40 PM
#4
Hyperactive Member
Meaning you wanted the forms to reload themselves?
53323737 15 743 313402 05 740313063. 17 15 4150 743 313402 05 140393403437 5203 743 30210.

-
Oct 31st, 2002, 07:58 PM
#5
Thread Starter
New Member
No.
No, I don't want the blasted forms to reload. I want the program to die so I can overwrite it...
-
Oct 31st, 2002, 09:42 PM
#6
Fanatic Member
I 'm not really sure I understand . . .
but you need to terminate your class before you unload your forms
VB Code:
'you created your class instance as some point
Dim classinstance As yourclassmodule
'you need to terminate this class
Set classinstance = Nothing
'then unload all forms
I hope I am understanding you correct . . .
"Look! Up in the sky! It's a bird! It's a plane! It's Diaper-Head Boy! (there by my name!) Yes, Diaper-Head Boy, who disguised as my son, Seth, fights a never-ending battle for truth, justice and terrorizing my house!
Resistance is futile, you will be compiled . . . Please!
-
Oct 31st, 2002, 09:46 PM
#7
The picture isn't missing
calling anything of the form will reload the form, so make sure that you are not doing that, even something like
If Form1.Visible = True Then
will reload form1
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Nov 3rd, 2002, 08:58 PM
#8
Thread Starter
New Member
Thanks, but due to the nature of the Class Module, which is to say, I don't create it, it's internal to my application and completely public.
I can't terminate it that way. I'll have a look in case I'm missing something like that but I don't think so.
By the way, the only calls I'm making to the other forms, is "Unload", so they should not be reloading at all.
Thanks for the help people. But is there a Windows API Call to destroy my instance of the application? I don't need to gracefully terminate it because it finishes all it's tasks before beginning the download.
-
Nov 3rd, 2002, 09:04 PM
#9
A different approach....
Create a loader program. This loader program checks a registry value to see if it should download. Complete the download and replace the EXE that is not even loaded into memory. Load your program as usual.
From your current app, instead of downloading, just set the flag in the registry and tell the user to shut down the application and restart it.
Hope this helps,
-
Nov 3rd, 2002, 09:07 PM
#10
Hyperactive Member
I think you are going to need a loader app.
This would be a second application that looks at the version of the main app and goes and gets the new one if it's needed. It hen starts the main app with a shell command kills itself.
FW
-
Nov 3rd, 2002, 09:14 PM
#11
Thread Starter
New Member
Thanks, it's probably the best idea I'll get. Damn, it's inconvenient though.
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
|