Question on Program Execution. 
Author Message
 Question on Program Execution.

Hello,

I wrote a program that performs various tasks. It is a MDI application.
An example is one of the forms has some labels and a button. When
button is clicked, the program combs through an access DB and makes
changes as needed. As it goes through, a counter is updated on the form
to let the user know things are working.

Question/Scenerio:
Everything is great but when I go to look at another program, say
netscape or winamp or whatever, I can not look at the application
again, it is frozen. Windows says program is not responding. It is
still working however and once it completes its tasks, I can view the
app again.

Am I doing too much in VB or am I missing something?

Any help is appreciated.

Sent via Deja.com
http://www.*-*-*.com/



Mon, 02 Jun 2003 07:16:36 GMT  
 Question on Program Execution.
Hi There,

Whenever a VB Program is hard at work, you will want to strategically place
"DoEvents" Statements in the various loops.

DoEvents allows Windows to process other pending requests from other
applications.

I say strategically since this:

For i = 1 to 5
    for j = 1 to 1000000
       'Do Something which takes a while
    next
   Doevents
next

is much worse than this:

For i = 1 to 5
    for j = 1 to 1000000
       'Do Something which takes a while
      Doevents
    next
next

Consider how frequently these two examples will yield control with the
DoEvents Statemnt.

HTH

--
-Dick Christoph

http://www1.minn.net/~dchristo

Quote:

> Hello,

> I wrote a program that performs various tasks. It is a MDI application.
> An example is one of the forms has some labels and a button. When
> button is clicked, the program combs through an access DB and makes
> changes as needed. As it goes through, a counter is updated on the form
> to let the user know things are working.

> Question/Scenerio:
> Everything is great but when I go to look at another program, say
> netscape or winamp or whatever, I can not look at the application
> again, it is frozen. Windows says program is not responding. It is
> still working however and once it completes its tasks, I can view the
> app again.

> Am I doing too much in VB or am I missing something?

> Any help is appreciated.

> Sent via Deja.com
> http://www.deja.com/



Mon, 02 Jun 2003 07:41:33 GMT  
 Question on Program Execution.
Bung a few DoEvents' in. That'll probably sort it out.

Rich Cain.



Tue, 03 Jun 2003 20:13:38 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help - Module Execution in another program

2. Pausing program execution

3. Displaying Cursor during program execution

4. CA-Realizer program execution speed problem !!!

5. Count Program Executions

6. Remote execution of programs

7. Ending program execution

8. clicking on menus stops program execution.??

9. Stopping Execution of an MS-DOS program from VB

10. program to monitor execution and shutdown of applications

11. How to delay execution of a program?

12. Q: Why program execution stops when moving window?

 

 
Powered by phpBB® Forum Software