Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / September 2004

Tip: Looking for answers? Try searching our database.

processing of windows messages during long operation?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Martin - 24 Sep 2004 19:58 GMT
Hi,

My code has a long operation to do, and I want to let other windows messages
be processed whilst I do that operation.  Casting my mind back 10 years, I
can't remember the call to do this.

Can some one tell me the answer?

Thanks
Martin
Imran Koradia - 24 Sep 2004 20:08 GMT
you could use Application.DoEvents(). But as experts in this (and other
dotnet groups) would agree, You should avoid using DoEvents and rather use
Threads. Read up on threads - it shouldn't be too much of an effort. In the
end, it'll be worth it.
The idea is to have your long operation run on a seperate thread so that the
main thread (one that the UI is running on) is free to process window
messages.

hope that helps..
Imran.

> Hi,
>
[quoted text clipped - 6 lines]
> Thanks
> Martin
Martin - 24 Sep 2004 20:09 GMT
DoEvents is was I was looking for - I actually want to give feed back on the
long operation whilst it is going on by writing to a log window.

This is just a little utility app so I think DoEvents will be enough for me.

Thanks for the speedy reply!
Martin

> you could use Application.DoEvents(). But as experts in this (and other
> dotnet groups) would agree, You should avoid using DoEvents and rather use
[quoted text clipped - 18 lines]
> > Thanks
> > Martin
Piotrek - 25 Sep 2004 09:50 GMT
Hi

You can put your processing in a class and interact with UI with events

this is an excellent exemple ( in french :S but the code is easy to
understand)
http://blogs.microsoft.fr/pascalbe/archive/2004/09/21/227.aspx
http://www.olymars.net/Blogs/EventsDelegates/EventsDelegates.zip

it gives feedback on a file copy (time, progress...)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.