ronwilliams
05-28-2009, 06:18 AM
Hi, AMS is the best by FAR! unfortunately I did stuff years ago on another CRAP program with a very unstable runtime! No the client wants it and it is way.. to much work to redo in AMS. soo... I use AMS as frame to run the older "player.exe" application, but now and then PLAYER crashes and gives me the
""""An unexpected error occurred...click CANCEL or SEND report""""""""""
and just sits there without going back to AMS
Is there any way to have AMS be on the lookout for this and restart the app if it happens???
I have :
file_to_check_for = "player.exe";
--------debugging helper
StatusDlg.Show();
StatusDlg.SetMessage(" PLEASE WAIT..............");
Page.StopTimer(num_Interval);
-- now run the program (WaitForReturn = false)
File.Run(_DesktopFolder.."\\OLDER\\SOFTWARE\\eXPORT\\PLAYER.EXE", "", "", SW_SHOWNORMAL, false);
-- here until we see the process active----
repeat
found = false;
processes = Window.EnumerateProcesses();
for j, file_path in processes do
file = String.SplitPath(file_path);
if (String.Lower(file.Filename..file.Extension) == file_to_check_for) then
found = true;
end
end
Application.Sleep(500);
until (found == true);
-- Update debug
StatusDlg.SetMessage("FINISHED,PLEASE WAIT..............");
-- Now the process is running, wait for it to end------------
repeat
active = false;
processes = Window.EnumerateProcesses();
for j, file_path in processes do
file = String.SplitPath(file_path);
if (String.Lower(file.Filename..file.Extension) == file_to_check_for) then
active = true;
end
end
Application.Sleep(500);
until (active == false);
""""An unexpected error occurred...click CANCEL or SEND report""""""""""
and just sits there without going back to AMS
Is there any way to have AMS be on the lookout for this and restart the app if it happens???
I have :
file_to_check_for = "player.exe";
--------debugging helper
StatusDlg.Show();
StatusDlg.SetMessage(" PLEASE WAIT..............");
Page.StopTimer(num_Interval);
-- now run the program (WaitForReturn = false)
File.Run(_DesktopFolder.."\\OLDER\\SOFTWARE\\eXPORT\\PLAYER.EXE", "", "", SW_SHOWNORMAL, false);
-- here until we see the process active----
repeat
found = false;
processes = Window.EnumerateProcesses();
for j, file_path in processes do
file = String.SplitPath(file_path);
if (String.Lower(file.Filename..file.Extension) == file_to_check_for) then
found = true;
end
end
Application.Sleep(500);
until (found == true);
-- Update debug
StatusDlg.SetMessage("FINISHED,PLEASE WAIT..............");
-- Now the process is running, wait for it to end------------
repeat
active = false;
processes = Window.EnumerateProcesses();
for j, file_path in processes do
file = String.SplitPath(file_path);
if (String.Lower(file.Filename..file.Extension) == file_to_check_for) then
active = true;
end
end
Application.Sleep(500);
until (active == false);