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. multithreading

multithreading

Scheduled Pinned Locked Moved Visual Basic
8 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.
  • J Offline
    J Offline
    johnjsm
    wrote on last edited by
    #1

    Hi, I have a piece of code which reads the contents of a cd to and image file using a DOS command line program. While this is running the main window becomes frozen. Does anyone know how I can create a thread that deals with the command line program so that the window does not freeze. Thanks

    D 1 Reply Last reply
    0
    • J johnjsm

      Hi, I have a piece of code which reads the contents of a cd to and image file using a DOS command line program. While this is running the main window becomes frozen. Does anyone know how I can create a thread that deals with the command line program so that the window does not freeze. Thanks

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Let's see the code your using to launch this command line process and interact with it. Usually, something like this doesn't block your interface, unless your doing a WaitForExit on the Process object.

      Dave Kreskowiak Microsoft MVP - Visual Basic

      J 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Let's see the code your using to launch this command line process and interact with it. Usually, something like this doesn't block your interface, unless your doing a WaitForExit on the Process object.

        Dave Kreskowiak Microsoft MVP - Visual Basic

        J Offline
        J Offline
        johnjsm
        wrote on last edited by
        #3

        Hi, This is the code I am using to launch the command Dim command As String command = "C:\readcd dev=1,0,0 f=c:\johntest2.iso" Shell(command, AppWinStyle.Hide) I am also hoping to display a message when the command has finnished. -- modified at 7:23 Wednesday 10th January, 2007

        D 1 Reply Last reply
        0
        • J johnjsm

          Hi, This is the code I am using to launch the command Dim command As String command = "C:\readcd dev=1,0,0 f=c:\johntest2.iso" Shell(command, AppWinStyle.Hide) I am also hoping to display a message when the command has finnished. -- modified at 7:23 Wednesday 10th January, 2007

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Are you using VB.NET or VB6??

          Dave Kreskowiak Microsoft MVP - Visual Basic

          J 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Are you using VB.NET or VB6??

            Dave Kreskowiak Microsoft MVP - Visual Basic

            J Offline
            J Offline
            johnjsm
            wrote on last edited by
            #5

            Sorry Dave. I am using VB.net 2003.

            D 1 Reply Last reply
            0
            • J johnjsm

              Sorry Dave. I am using VB.net 2003.

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              OK. The code you posted is old VB6 stuff. But, in either case, Shell isn't a blocking call, so... There's something else that's hanging up your app. Is it possible that the app you launched is taking up 100% of the CPU??

              Dave Kreskowiak Microsoft MVP - Visual Basic

              J 1 Reply Last reply
              0
              • D Dave Kreskowiak

                OK. The code you posted is old VB6 stuff. But, in either case, Shell isn't a blocking call, so... There's something else that's hanging up your app. Is it possible that the app you launched is taking up 100% of the CPU??

                Dave Kreskowiak Microsoft MVP - Visual Basic

                J Offline
                J Offline
                johnjsm
                wrote on last edited by
                #7

                Hi The app probably would be using most of the cpu time. I came across the process.start which seems to help. Would this be the best thing to use.

                D 1 Reply Last reply
                0
                • J johnjsm

                  Hi The app probably would be using most of the cpu time. I came across the process.start which seems to help. Would this be the best thing to use.

                  D Offline
                  D Offline
                  Dave Kreskowiak
                  wrote on last edited by
                  #8

                  Yep. Launching a new process automatically give it it's own thread. It's not dependant on the threads of your app, so launching another thread won't help.

                  Dave Kreskowiak Microsoft MVP - Visual Basic

                  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