15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


No OnIdle calls while in AfxMessageBox

Hans Billiet -- hab@barco.be
Monday, April 15, 1996

ENV: Visual C++ 1.52, Windows 3.11/Windows 95

I have a 16-bit CWinApp derived application that uses the CWinApp::OnIdle to
do a lot of background processing. This background processing is sometimes
time-critical, this means that it may not be blocked for more than a few
seconds. The problem is that when displaying a messagebox with the call
"AfxMessageBox", or when displaying one of the common dialogs to open or
save a file, the OnIdle member function is not called anymore.
Is there a solution without having to write my own common dialogs derived
from CDialog?

Thanks





Chong Zhang -- cz@dana.ucc.nau.edu
Wednesday, April 17, 1996

On Mon, 15 Apr 1996, Hans Billiet wrote:

> ENV: Visual C++ 1.52, Windows 3.11/Windows 95
> 
> I have a 16-bit CWinApp derived application that uses the CWinApp::OnIdle to
> do a lot of background processing. This background processing is sometimes
> time-critical, this means that it may not be blocked for more than a few
> seconds. The problem is that when displaying a messagebox with the call
> "AfxMessageBox", or when displaying one of the common dialogs to open or
> save a file, the OnIdle member function is not called anymore.
> Is there a solution without having to write my own common dialogs derived
> from CDialog?
> 

You will receive a WM_ENTERIDLE message when ever a dialog box or a menu 
entering idle state. You can call your OnIdle() when you receive this 
message.

> Thanks
> 
> 
> 



Frederic Steppe -- FredericS@msn.com
Saturday, April 20, 1996

> ENV: Visual C++ 1.52, Windows 3.11/Windows 95
> 
> I have a 16-bit CWinApp derived application that uses the CWinApp::OnIdle to
> do a lot of background processing. This background processing is sometimes
> time-critical, this means that it may not be blocked for more than a few
> seconds.    ....

If you background processing can't be interrupted for a given time, add a 
back-up mechanism using a timer,
and don't forget that your code may be stopped by other 'unfriendly' 
applications.

Frederic Steppe (frederics@msn.com)




Ron Forrester -- rjf@infograph.com
Wednesday, April 17, 1996

I'd use SetTimer to get a timer callback every 2 seconds (or whatever), and put your idle processing in there.

rjf

----------
From: 	Hans Billiet[SMTP:hab@barco.be]
Sent: 	Monday, April 15, 1996 1:07 AM
To: 	mfc-l@netcom.com
Subject: 	No OnIdle calls while in AfxMessageBox

ENV: Visual C++ 1.52, Windows 3.11/Windows 95

I have a 16-bit CWinApp derived application that uses the CWinApp::OnIdle to
do a lot of background processing. This background processing is sometimes
time-critical, this means that it may not be blocked for more than a few
seconds. The problem is that when displaying a messagebox with the call
"AfxMessageBox", or when displaying one of the common dialogs to open or
save a file, the OnIdle member function is not called anymore.
Is there a solution without having to write my own common dialogs derived
from CDialog?

Thanks




| Вернуться в корень Архива |