Re: Long Process
- From: Joergen Bech <jbech<NOSPAM>@<NOSPAM>post1.tele.dk>
- Date: Fri, 23 May 2008 08:24:53 +0200
There are many language features coming from VB6 that have found
a new home at the core of the framework because that is where they
belong rather than just in the Microsoft.VisualBasic namespace.
Leaving it out would mean one more thing preventing many VB6
applications from being ported to .Net.
What DoEvents does could be achieved with other languages
as well - including non-Microsoft languages before .Net.
It is still a bad practice for all the reasons discussed in this
thread (and more).
If you, say, google for discussions about how to accomplish the
same thing in Java, the discussions usually go along this line:
- a) Is there something similar to DoEvents in Java?
- b) What the heck is DoEvents and why do you need it?
- a) (explains)
- b) Don't do that. Do it this way ...
Regards,
Joergen Bech
On Thu, 22 May 2008 21:29:55 -0700, Just_a_fan@xxxxxxxx wrote:
If DoEvents should not be used any more, why is it in the language?
application.doevents
That's the quickest way to get a control updated. Works just fine. This
is the first I have heard about it not being valid any longer. Does
Microsoft know about this?
Mike
On Thu, 22 May 2008 11:09:12 +0200, in
microsoft.public.dotnet.languages.vb "Armin Zingler"
<az.nospam@xxxxxxxxxx> wrote:
"Mayur H Chauhan" <mayur@xxxxxxxxxxxx> schrieb
How about Application.DoEvents ? This might help for processing
pending thread.
Doevents should not be used anymore. It was valid with previous VB
versions where multi threading was (appart from appartment threading)
almost impossible. Doevents creates more problems than necessary. First,
the classification of UI tasks and independent other tasks would have to
be removed. Not every task has an abstract and regular event/callback
mechanism that can be used to update the UI, especially when talking
about long running database activities. In addition, you'd have
to be aware of code reentrance. Moreover, why create new code to process
messages even if there is already a message loop that is made for it? My
experience is that almost every time when I was using Doevents, 5 LOC
later I'd wished to go the "clean" way and had used a separate thread
instead.
Armin
.
- References:
- Long Process
- From: John Wright
- Re: Long Process
- From: Mayur H Chauhan
- Re: Long Process
- From: Armin Zingler
- Re: Re: Long Process
- From: Just_a_fan
- Long Process
- Prev by Date: Re: building my .exe can it run anywhere?
- Next by Date: Re: building my .exe can it run anywhere?
- Previous by thread: Re: Re: Long Process
- Next by thread: Re: Re: Long Process
- Index(es):
Relevant Pages
|
Loading