VB.Net Console - DoEvents???

Hello, my Console application, made with VB.Net 2003, need a Application.DoEvents routine!!! :(

As i understand this is not possible, then i use a simple Thread.sleep.....

This is not the same, not?
I think the use of this function should make my app more slow....and sometime busy...

Please, someone know the way to simulate a DoEvents better then the use of the Sleep function?

Thanks a lot!

Who is Participating?
DoEvents is only applicable for Forms based applications.

The sleep method puts the thread that your application is on to sleep for the specific amount of time. I am not sure about the specifics, but I think that If one application starts another then they are potentially on the same thread and so what you mentioned happens.

If you have 2 applications, interacting on the same machine, why are they seperate applications? If you combined them and threaded you application, you could acheive what you want.

Just my thoughts.

SubSonicSAuthor Commented:
Ps: Let me explain more:

My Console Application is not Alone and work with a Windows Application by Communicating by Windows Registry...

It is like a Server and a Client..

Every time the 'ball' is to the Windows Application, the Console Application must do something but must also wait for the 'ball' again....

If i use the Sleep function, then the Console Freeze for the Sleep time and cannot do nothing...
If i use this console to launch a command line tools, this will slow significally once it is in the Sleep Status...

A Do While --- Loop naturally is the same as the Sleep one and the Console will freeze too...

As 'ball' i mean the Read/Write turn inside the Windows Registry...

SubSonicSAuthor Commented:
Ok, then how to combine a Window form based project with a Console one?
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

By console application I am assuming you mean an interface-less application, ie a background process or Service.

An Application can do whatever you want it to do. Many forms based applications have large amounts of code that has no interaction with the Form Interface.

Think about most non user applications that run under windows. Most have a configuration interface that uses forms. Therefore you have a forms interface and what would be considered a console application.

It would help if you could explain what the 2 layers do.

SubSonicSAuthor Commented:
Hi, the explanation should require about a month, and a lot of discussions are opened for this...

I should be more fast: i really need the Console...

By the way, Thanks a lot!


No Problems. Can you give me some pointers to the previous discussions?

Mike TomlinsonMiddle School Assistant TeacherCommented:
A Do...While Loop with a small call to Sleep *can* work.  What interval were you using?

SubSonicSAuthor Commented:
Thanks, i already use a do while with sleep inside....

The time i will use is indifferent...I already tried to change it...

Any dos application started throught the shell within my console go very slow...

Andrew, my old discussions are closed from 6 months or more, but here a summing up...

I need to use some console application which does not make Windows based form able to read the output.
We tried a lot of ReadPipe and stdOut...
Most common dos based application(98%) give no problem when reading its output, but the one i need to use is very heavy...Cannot read it before it finish his work...

The solution was very interesting...

I builded a Console application with .Net and i applyied on that a perfect screenreader with the use of some old APIs. I don't receive the output, i really read the screen....

Now it work perfectly, but slow because i need this Doevents...

Hope my English could be understanded by you, because i'm Italian...
SubSonicSAuthor Commented:
By the way, i forgot to tell you that i already create 2 other threads..
The first to launch the application with the shell.
The second to read its output and to communicate throught the Windows Registry...

Then i thinked: i will give more Priority to the Shelled application and less to the Readers and Communicator...

Then i got of only the shelled Application work correctly and the other thred stay inactive until the first end...

eheh ;)
SubSonicSAuthor Commented:
No solution around the world...
All web page i found with this similar issue tell the samething: It is not possible...

I will try more with the use of the 2 different threads...

Thanks a lot for your time..

Best Regards
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.