Re: Long Process




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

.



Relevant Pages

  • Re: VB6, VB2005, or Something Else?
    ... I don't know VB6 that much, but I don't hate it because I don't know it or just because many C++ programmers dislike it. ... If I understood you well and IIRC the IDE enforces a unique write style, while the compiler would not complain about variables, function with the same name but different case. ... A common problem case insensitive compilers have is that languages which don't have an 100% identical conversion from upper case to lower case and vice versa. ...
    (microsoft.public.vb.general.discussion)
  • Re: I used to use VB but...
    ... |> with all the features of VB6 and more". ... |> a bitmap pixel by pixel in vb6. ... |> respective merits of the two Microsoft languages that are currently ... |> mind, but throughout the last twelve months or so you've been banging on ...
    (microsoft.public.vb.general.discussion)
  • Re: Multithreading
    ... "Schmidt" wrote in message ... > to do other things in a multithreading manner. ... of those languages, which allows smaller deployment-packages. ... async-APIs could be implemented also directly within VB6. ...
    (microsoft.public.vb.general.discussion)
  • Re: Visual Studio Professional Edition purchase
    ... In the latter three you are in fact creating forms and things like that almost exact in the same way as you did with VB6. ... Beside that there is in Visual Studio the original C++ as it was in Visual Studio 6 using MFC. ... It is not my goal to start a discussion, so if you should go to a C language is your own decission and it is never wrong to learn both languages. ... and HTML (if you can call HTML programming). ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Event Handling in vb.net
    ... >>My unstanding of all VB up to and including vb6 is that an event could not ... > When you call DoEvents or its equivalent any event can occur a second time, ... > pump that causes Windows Messages in the Windows Message ... > problems if DoEvents is called with in Timer Tick, ToolBar ButtonClick, ...
    (microsoft.public.dotnet.languages.vb)

Loading