Peter, I theory you can use Create Process followed by WaitForSingleObject. I have not done this in MapBasic, but have found example functions intended to do this in Delphi. I have been recently working on a Delphi program one stage of which consists of feeding a list of MapInfo tables to the Universal Translator. My original expectation was that I would run IMUT.EXE for each table and wait for it to finish before calling it for the next - similar to what your situation is. However, I did not manage to get a WinExecAndWait function to work as expected, and in the interest of meeting a deadline decided to instead generate a batch file which would then call IMUT.EXE for each table. This does not 'wait', but it does run each invocation as a separate process, so they don't conflict with each other. (This may actually be more efficient than running them one after another, but that's another story...) The piece I need to work out now to fully automate my conversion is monitoring all running processes so that I know when the last one has finished and can safely move on to the next step. (For purposes of my immediate data conversion project I just watched the task manager listing...)
If this approach does not help in your situation, you might try checking out VB sites and newsgroup archives for a WinExecAndWait function. Since VB and MB are so similar anything you find there could probably be dropped into your code with minimal changes. Let us know how you make out. >Has anyone tried using some API function to start an application and = >wait for this application to finish ? > >I know about the WinExecute but this doesn't wait until the application = >has finished. There is also a function called CreateProces, but it look = >quite a bit more complicated, so if anyone had allready implemented this = >function in MapBasic I'd love to know. > >Cheers, >Peter Horsb=F8ll M=F8ller >GIS Udvikler >Geographical Information & IT -- Mickey Feldman [EMAIL PROTECTED] --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 11275
