Halt, Break, Pause
-
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
-
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
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
-
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
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.
-
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.
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
-
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.
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
-
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
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."
-
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."
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".
-
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".
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