AppClose - Serious Error

rbw152

Member
Licensed User
Longtime User
Hi

I am using a bit of FTP code to check for a newer version of a program on a server and if there is one available it notifies the user so they can download it. If they choose to do this I use a Shell command to start an Updater program and AppClose to close the current program, like this:

Shell(AppPath & "\Updater.exe",FName & " " & ServerIP)
AppClose

This works fine on the emulator but when I load it onto the mobile device it shows an error: 'Application algastrack.exe encountered a serious error and must shut down.' immediately after the updater program has started.

Anybody got any idea why this happens? Is it because the mobile device registers AppClose as an unscheduled shutdown or something?

Thanks.
 

mjcoon

Well-Known Member
Licensed User
Hi

I am using a bit of FTP code to check for a newer version of a program on a server and if there is one available it notifies the user so they can download it. If they choose to do this I use a Shell command to start an Updater program and AppClose to close the current program, like this:

Shell(AppPath & "\Updater.exe",FName & " " & ServerIP)
AppClose

This works fine on the emulator but when I load it onto the mobile device it shows an error: 'Application algastrack.exe encountered a serious error and must shut down.' immediately after the updater program has started.

Anybody got any idea why this happens? Is it because the mobile device registers AppClose as an unscheduled shutdown or something?

Thanks.

1) Is "algastrack.exe " the name of the running program?

2) When you say "immediately after ...", does that mean the if you put a MsgBox() between Shell() and AppClose the crash precedes the MsgBox?

Mike.
 

rbw152

Member
Licensed User
Longtime User
Hi Mike

yes, 'algastrack.exe' is the name of the running program.

I tried your suggestion about the msgbox but the same thing happens, the error message appears just after I click OK on the message.
 

mjcoon

Well-Known Member
Licensed User
Hi Mike

yes, 'algastrack.exe' is the name of the running program.

I tried your suggestion about the msgbox but the same thing happens, the error message appears just after I click OK on the message.

OK, so I have another suggestion. Since the Shell() itself plainly doesn't cause the crash (else you would not get the MsgBox!), how about calling any other exe instead of yours to see if that is the problem.

(This is how to home in on faults; stepwise "softly, softly, catchee monkey"...)

Mike.
 

rbw152

Member
Licensed User
Longtime User
Hi Mike

thanks for replying. I'm still working on this but I have some more info now.

I run the sub that checks for updates in the App_Start Sub. It is in a separate module called modUpdate. If there are no updates, the App_Start sub will just show the login form for the app, frmLogin.Show

However, the program still errors if do not even use the AppClose call. For example, I understand that if no form is shown in App_Start the program will end anyway, so I have ditched the AppClose call and just let the program end by not showing the Login form if the user chooses to update - yet I still get the error as the program closes. (see below)

If modUpdate.CheckforUpdates(sServerIP,"algastrack.exe") = True Then
Shell(AppPath & "\Updater.exe","algastrack.exe" & " " & sServerIP)
else
frmLogin.Show
end if

Return

(sorry, can't get indenting to work in this post)

Everything works OK by the way, it's just that the error appears after the program has closed!
 

rbw152

Member
Licensed User
Longtime User
Hi

just to let you know, the problem was with a Panel control being used. It contained two radio buttons and when I removed and it's controls the program worked ok.

All I did was remove the panel and radio buttons, compiled, then added them again and compiled again and it all seems to work now.

I have to go through each screen removing controls until I found which one had the problem, very tedious and I'm still not sure what the problem was.

Thanks for you help anyway guys.
 
Top