Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Problem with shell running asynchronously

Problem with shell running asynchronously

Scheduled Pinned Locked Moved Visual Basic
questionsysadminlinuxhelptutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Carolina
    wrote on last edited by
    #1

    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

    C 1 Reply Last reply
    0
    • C Carolina

      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

      C Offline
      C Offline
      Carlos Antollini
      wrote on last edited by
      #2

      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

      C 1 Reply Last reply
      0
      • C Carlos Antollini

        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

        C Offline
        C Offline
        Carolina
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups