467,208 Members | 1,352 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,208 developers. It's quick & easy.

How to keep an active "Stop button" while application is reading file

I have an Application C# handling file reading, building index on this file, using dll wrapped with SWIG. The dll is originaly programmed in C++.

Dll reports back to the the C# programm throug callback/delegates. Among others, it reports index building(%). One callback function can receive (stop order) to stop reading file/building index. How ever i do not know how to keep the stopbutton activ while this file reading is going on.

I have not tried threading before.

Can I keep this one button active running it on a separete thread ?
Nov 10 '10 #1
  • viewed: 1936
Share:
1 Reply
HaLo2FrEeEk
256MB
If your read is happening in a loop, try Application.DoEvents(), it'll force the application to flush all pending actions. The other option is to run the read process in it's own thread, or a background worker.
Nov 12 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Tom Youngquist | last post: by
reply views Thread by Henke | last post: by
2 posts views Thread by Chameleon | last post: by
2 posts views Thread by HockeyFan | last post: by
reply views Thread by hhoang.nl@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.