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. C / C++ / MFC
  4. Halt, Break, Pause

Halt, Break, Pause

Scheduled Pinned Locked Moved C / C++ / MFC
questiondebugging
8 Posts 5 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.
  • T Offline
    T Offline
    tanarnelinistit
    wrote on last edited by
    #1

    I have a program that works just fine if I run it in Debug mode and set up a break point at a specific line. If i run it normaly it doesn't work, Beacuse it skips to fast that part of the program. Now here i am asking you, how can i stop the execution for let me say 3 seconds? Thanks

    C N 2 Replies Last reply
    0
    • T tanarnelinistit

      I have a program that works just fine if I run it in Debug mode and set up a break point at a specific line. If i run it normaly it doesn't work, Beacuse it skips to fast that part of the program. Now here i am asking you, how can i stop the execution for let me say 3 seconds? Thanks

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You can stop the program, but really you need to fix your design. Why is it 'too fast' ? You've not described what it does. If you want to stop for the user to read something, don't select an arbitrary time, show it in a message box that they can close whenever they want. Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

      T 1 Reply Last reply
      0
      • C Christian Graus

        You can stop the program, but really you need to fix your design. Why is it 'too fast' ? You've not described what it does. If you want to stop for the user to read something, don't select an arbitrary time, show it in a message box that they can close whenever they want. Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

        T Offline
        T Offline
        tanarnelinistit
        wrote on last edited by
        #3

        The program reads a string from the COM port and then enters it in a database. Because the system reads the port to fast and then tryes to enter the string to the database, i only get the first char of the string in the database.

        T C 2 Replies Last reply
        0
        • T tanarnelinistit

          The program reads a string from the COM port and then enters it in a database. Because the system reads the port to fast and then tryes to enter the string to the database, i only get the first char of the string in the database.

          T Offline
          T Offline
          ThatsAlok
          wrote on last edited by
          #4

          tanarnelinistit wrote:

          he program reads a string from the COM port and then enters it in a database.

          hows your program read string from COM port... as you can read only a byte at time from comport!

          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You

          1 Reply Last reply
          0
          • T tanarnelinistit

            The program reads a string from the COM port and then enters it in a database. Because the system reads the port to fast and then tryes to enter the string to the database, i only get the first char of the string in the database.

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            Then you need to come up with a way to know that all the string has come through - is it null terminated ? Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

            1 Reply Last reply
            0
            • T tanarnelinistit

              I have a program that works just fine if I run it in Debug mode and set up a break point at a specific line. If i run it normaly it doesn't work, Beacuse it skips to fast that part of the program. Now here i am asking you, how can i stop the execution for let me say 3 seconds? Thanks

              N Offline
              N Offline
              NiceNaidu fo
              wrote on last edited by
              #6

              What is problem exactly ?? Are u getting the complete data through the port ?? Give us some more details.. Appu.. "If you judge people, you have no time to love them."

              T 1 Reply Last reply
              0
              • N NiceNaidu fo

                What is problem exactly ?? Are u getting the complete data through the port ?? Give us some more details.. Appu.. "If you judge people, you have no time to love them."

                T Offline
                T Offline
                tanarnelinistit
                wrote on last edited by
                #7

                Ok I'm using a code posted on this side under C++ serial class, I read from the port 16 bytes and i want to write them in the database, i got the string into the database but i seem to get some nasty results too. I should get smth like "FFFF00000000028C" but there are times when i get " FFF00000000028".

                R 1 Reply Last reply
                0
                • T tanarnelinistit

                  Ok I'm using a code posted on this side under C++ serial class, I read from the port 16 bytes and i want to write them in the database, i got the string into the database but i seem to get some nasty results too. I should get smth like "FFFF00000000028C" but there are times when i get " FFF00000000028".

                  R Offline
                  R Offline
                  Rilhas
                  wrote on last edited by
                  #8

                  I think you could get more help if you were questioning your design instead of asking for a direct solution. Anyway, concerning your original question, you can make a program slower by calling ::Sleep(milliseconds). If you wait for 10ms or 20ms you can check the port again to see if you received more data. To wait 3 seconds you would call ::Sleep(3000). Under Windows 95/98/Me the smallest time that actually has a wait effect is 50ms, on NT/2K/XP you can use 10ms as the smallest wait time. Anyway, it seems to me that a good design would be better than using ::Sleep() to solve a timing problem. I hope this helps, Rilhas -- modified at 18:10 Friday 21st July, 2006

                  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