Problem with shell running asynchronously
-
Hi! I am using shell to start ftp and send a few commands to a server, resulting in a file being retreived. I then process the file locally. I need to do this with a group of files, so i'm running this in a loop and this gets me into trouble. All of a sudden, ftp commands show up in the document, since the processing of one file conicides with the retreival of another. I believe that the source of my problems is that shell runs asynchronously. MS states that it does this *by default*. How can I change this default? Or is there some smart work-around I haven't thought of? I already use a loop with DoEvents(), to give the ftp process time to get started before I send any commands to it, and I have a control to ensure that only one ftp process is running at a time (static variable in the procedure). Any ideas on how to solve this? Consultant, system/web developer. IMS Consulting AB, Sweden
-
Hi! I am using shell to start ftp and send a few commands to a server, resulting in a file being retreived. I then process the file locally. I need to do this with a group of files, so i'm running this in a loop and this gets me into trouble. All of a sudden, ftp commands show up in the document, since the processing of one file conicides with the retreival of another. I believe that the source of my problems is that shell runs asynchronously. MS states that it does this *by default*. How can I change this default? Or is there some smart work-around I haven't thought of? I already use a loop with DoEvents(), to give the ftp process time to get started before I send any commands to it, and I have a control to ensure that only one ftp process is running at a time (static variable in the procedure). Any ideas on how to solve this? Consultant, system/web developer. IMS Consulting AB, Sweden
You need to run the preocess with the CreateProcess API... You can test if the process is running, etc. If you want I made a COM dll with VC++ for make that you need... ;) ;) ;) Best Reagards Enter any 11-digit prime number to continue... Carlos Antollini. Sonork ID 100.10529 cantollini
-
You need to run the preocess with the CreateProcess API... You can test if the process is running, etc. If you want I made a COM dll with VC++ for make that you need... ;) ;) ;) Best Reagards Enter any 11-digit prime number to continue... Carlos Antollini. Sonork ID 100.10529 cantollini
I'm not sure what the CreateProcess API is. If you have a nice little component that might help, I'd be very glad to try it out! Please send it to my email :-D If you understand my dilemma, would you mind trying to explain to me how this process works/should work? Consultant, system/web developer. IMS Consulting AB, Sweden