Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VB.Net Console - DoEvents???

Posted on 2004-11-01
10
Medium Priority
?
3,233 Views
Last Modified: 2008-02-01
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!

Stefano
 
0
Comment
Question by:SubSonicS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
10 Comments
 

Author Comment

by:SubSonicS
ID: 12468921
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...

Regards..
0
 
LVL 4

Accepted Solution

by:
andrewharris earned 200 total points
ID: 12469331
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.

Andrew
0
 

Author Comment

by:SubSonicS
ID: 12471546
Ok, then how to combine a Window form based project with a Console one?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 4

Expert Comment

by:andrewharris
ID: 12471884
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.

andrew
0
 

Author Comment

by:SubSonicS
ID: 12472586
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!


Regards.
Stefano
0
 
LVL 4

Expert Comment

by:andrewharris
ID: 12472991
Stafano,

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

Andrew
0
 
LVL 86

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 200 total points
ID: 12473028
A Do...While Loop with a small call to Sleep *can* work.  What interval were you using?

~IM
0
 

Author Comment

by:SubSonicS
ID: 12478788
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...
 
0
 

Author Comment

by:SubSonicS
ID: 12478825
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 ;)
Stefano
0
 

Author Comment

by:SubSonicS
ID: 12478911
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
Stefano
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question