Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem closing my application on version check

Status
Not open for further replies.

davidck88

Programmer
Jan 5, 2009
27
NL
Hi all.I am using the following code to check for version of my program and if the current version is old i tell the user to update and close the applicaton completly. The current code does tell the user that application is old but that massage keeps coming over and over ... Like i am in infinite loop or something. Could any one tell me how i can fix this problem and close my application completly and come out of that infinite loop ?

Note : the following code is placed near end of onload event

Code:
Dim LatestVersion As Single
     Dim CurrentVersion As Single

     CurrentVersion = 2

     LatestVersion = Val(Inet1.OpenURL("[URL unfurl="true"]http://somesite.com/ts.txt"))[/URL]

    If LatestVersion > CurrentVersion Then
         MsgBox "old version!!!"
         Unload Me
    End If
 

Well if you are correct in that you are calling unload event i.e. unload me, from within the onload event then you have your answer and only needed another set of eyes to point this out to you.

Meaning you are telling the form to unload before it is fully loaded so it starts all over again.

Good Luck

 
Thanks for pointing out . So how to close the application completely ? i don't the massage pops up and the application loads ...
 
Do your check in a sub main. No form is loaded when the check is done. Then when you exit the sub it should exit cleanly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top