| | |
stop method from executing
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jan 2008
Posts: 2,052
Reputation:
Solved Threads: 118
actually my problem was device specific, the scantimeout can be set to 10 seconds which means it is going to scan continuously for 10 seconds, i wanted to stop it but i couldnt because it only stops when the timout is reached or the key is released or something is scanned. i work on handheld dolphin 7900 with sdk 111, it appearantly does not have such method to interrupt scanning.
Due to lack of freedom of speech, i no longer post on this website.
Could you maybe set a scan timeout for a shorter period of time, set that running on a thread, and have that thread check for some type of stop "signal" before scanning again? I think a Singleton pattern or something could work for this:
instantiate a "ScanMonitor" object that has a "Cancel" boolean property. (This can go to your scan() method)
Then, you could have another thread change ScanMonitor's Cancel property to "true" when you need to stop scanning.
set a while(true) loop to keep looping on that scan method with a short scan time, but before you scan, check if ScanMonitor.Cancel == true.
Does that make sense?
instantiate a "ScanMonitor" object that has a "Cancel" boolean property. (This can go to your scan() method)
Then, you could have another thread change ScanMonitor's Cancel property to "true" when you need to stop scanning.
set a while(true) loop to keep looping on that scan method with a short scan time, but before you scan, check if ScanMonitor.Cancel == true.
Does that make sense?
Alex Cavnar, aka alc6379
•
•
Join Date: Jan 2008
Posts: 2,052
Reputation:
Solved Threads: 118
•
•
•
•
Could you maybe set a scan timeout for a shorter period of time, set that running on a thread, and have that thread check for some type of stop "signal" before scanning again? I think a Singleton pattern or something could work for this:
instantiate a "ScanMonitor" object that has a "Cancel" boolean property. (This can go to your scan() method)
Then, you could have another thread change ScanMonitor's Cancel property to "true" when you need to stop scanning.
set a while(true) loop to keep looping on that scan method with a short scan time, but before you scan, check if ScanMonitor.Cancel == true.
Does that make sense?
i think i could use some multithreading functionality like abort or interrupt thread, but anyway simpler is better.
thanks.
Due to lack of freedom of speech, i no longer post on this website.
To stop it noway else putting it on a specific thread then in some defined cases you kill this thread.
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
![]() |
Similar Threads
- Send data on a serial port (C++)
- Cannot find server or DNS Error - please help! (Viruses, Spyware and other Nasties)
- cancelling the actionPerformed (Java)
- Summing Issue from Array (Java)
- DatagramSocket auto-close? (Java)
Other Threads in the C# Forum
- Previous Thread: ConnecionString
- Next Thread: Performance problem with background image
| Thread Tools | Search this Thread |
.net access algorithm api array barchart bitmap box broadcast c# check checkbox client combobox communication control conversion csharp custom database datagrid datagridview dataset datetime decryption degrees development draganddrop drawing encryption enum event excel file form format forms function gdi+ grantorrevokepermissionthroughc#.net httpwebrequest image index input install java label list listbox mandelbrot marshalbyrefobject math mouseclick mysql netcfsvcutil.exe numeric operator path photoshop php picturebox pixelinversion platform polynomial post programming properties radians regex registry remote remoting richtextbox server sleep socket sql statistics stream string study sun table teamsuite text textbox thread time timer update usb usercontrol validation visualstudio webbrowser windows winforms wpf wpfc# xml






