I have an application which uses CreateProcess to start a separate smaller EXE which does some tasks and then terminates. I run it as a separate process so that if it hasn't finished after 30 seconds I can terminate it using TerminateProcess from within the main application.
A problem has arisen though; if a user closes the main application while the separate smaller EXE is running and then tries to restart the main application it won't run because the first few lines say "If App.PrevInstance = True Then End". I can confirm that no previous instance of the main application is running in task manager so I can only assume that for some reason VB thinks that the smaller EXE is in fact the same as the main EXE as far as PrevInstance is concerned.
Is there a way I can start the smaller EXE so that it doesn't interfere with App.PrevInstance?
- Andy
___________________________________________________________________
If a man speaks in a forest and there are no women around to hear him - will he still be wrong?
A problem has arisen though; if a user closes the main application while the separate smaller EXE is running and then tries to restart the main application it won't run because the first few lines say "If App.PrevInstance = True Then End". I can confirm that no previous instance of the main application is running in task manager so I can only assume that for some reason VB thinks that the smaller EXE is in fact the same as the main EXE as far as PrevInstance is concerned.
Is there a way I can start the smaller EXE so that it doesn't interfere with App.PrevInstance?
- Andy
___________________________________________________________________
If a man speaks in a forest and there are no women around to hear him - will he still be wrong?