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. Other Discussions
  3. The Weird and The Wonderful
  4. Who Needs BackgroundWorker....

Who Needs BackgroundWorker....

Scheduled Pinned Locked Moved The Weird and The Wonderful
10 Posts 9 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.
  • E Offline
    E Offline
    Evan St John
    wrote on last edited by
    #1

    StartLongRunningProcess() While (Some Condition That Last 3 Minutes) Application.DoEvents() End While StartAnotherLongRunningProcess() While (Some Condition That Last 3 Minutes) Application.DoEvents() End While ...found this today, almost died.

    S A D M V 6 Replies Last reply
    0
    • E Evan St John

      StartLongRunningProcess() While (Some Condition That Last 3 Minutes) Application.DoEvents() End While StartAnotherLongRunningProcess() While (Some Condition That Last 3 Minutes) Application.DoEvents() End While ...found this today, almost died.

      S Offline
      S Offline
      StM0n
      wrote on last edited by
      #2

      At least, you found it...

      (yes|no|maybe)*

      1 Reply Last reply
      0
      • E Evan St John

        StartLongRunningProcess() While (Some Condition That Last 3 Minutes) Application.DoEvents() End While StartAnotherLongRunningProcess() While (Some Condition That Last 3 Minutes) Application.DoEvents() End While ...found this today, almost died.

        A Offline
        A Offline
        AspDotNetDev
        wrote on last edited by
        #3

        And they didn't even have the decency to use Thread.Sleep in the loop?

        StartLongRunningProcess()
        While (Some Condition That Last 3 Minutes)
        Application.DoEvents()
        End While

        StartAnotherLongRunningProcess()
        While (Some Condition That Last 3 Minutes)
        Application.DoEvents()
        End While

        Even pseudo code benefits from indents and PRE tags. :)

        [WikiLeaks Cablegate Cables]

        1 Reply Last reply
        0
        • E Evan St John

          StartLongRunningProcess() While (Some Condition That Last 3 Minutes) Application.DoEvents() End While StartAnotherLongRunningProcess() While (Some Condition That Last 3 Minutes) Application.DoEvents() End While ...found this today, almost died.

          D Offline
          D Offline
          David1987
          wrote on last edited by
          #4

          I have yet to see a problem where Application.DoEvents is the right solution..

          Sander RosselS Q 2 Replies Last reply
          0
          • D David1987

            I have yet to see a problem where Application.DoEvents is the right solution..

            Sander RosselS Offline
            Sander RosselS Offline
            Sander Rossel
            wrote on last edited by
            #5

            Lazy@$$Co-Worker.DoEvents! :laugh:

            It's an OO world.

            M 1 Reply Last reply
            0
            • Sander RosselS Sander Rossel

              Lazy@$$Co-Worker.DoEvents! :laugh:

              It's an OO world.

              M Offline
              M Offline
              musefan
              wrote on last edited by
              #6

              :thumbsup::thumbsup::thumbsup::thumbsup::thumbsup:

              I may or may not be responsible for my own actions

              1 Reply Last reply
              0
              • E Evan St John

                StartLongRunningProcess() While (Some Condition That Last 3 Minutes) Application.DoEvents() End While StartAnotherLongRunningProcess() While (Some Condition That Last 3 Minutes) Application.DoEvents() End While ...found this today, almost died.

                M Offline
                M Offline
                musefan
                wrote on last edited by
                #7

                JNochowitz wrote:

                ...found this today, almost died.

                read this today, and almost wet myself!

                I may or may not be responsible for my own actions

                1 Reply Last reply
                0
                • E Evan St John

                  StartLongRunningProcess() While (Some Condition That Last 3 Minutes) Application.DoEvents() End While StartAnotherLongRunningProcess() While (Some Condition That Last 3 Minutes) Application.DoEvents() End While ...found this today, almost died.

                  V Offline
                  V Offline
                  Vladimir Svyatski
                  wrote on last edited by
                  #8

                  By the way, how does the author know that long running process takes exactly 3 minutes? :laugh: And where is parallelism? It can spare you 3 minutes!

                  1 Reply Last reply
                  0
                  • E Evan St John

                    StartLongRunningProcess() While (Some Condition That Last 3 Minutes) Application.DoEvents() End While StartAnotherLongRunningProcess() While (Some Condition That Last 3 Minutes) Application.DoEvents() End While ...found this today, almost died.

                    B Offline
                    B Offline
                    BillW33
                    wrote on last edited by
                    #9

                    Sadly I have seen a lot of legacy code where loops and Application.DoEvents()is the standard way to handle long processing times. X|

                    Just because the code works, it doesn't mean that it is good code.

                    1 Reply Last reply
                    0
                    • D David1987

                      I have yet to see a problem where Application.DoEvents is the right solution..

                      Q Offline
                      Q Offline
                      Quirkafleeg
                      wrote on last edited by
                      #10

                      I found found only one place - when using the unmanged function "SHAppBarMessage", with ABM_SETPOS.

                      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