473,387 Members | 1,545 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

can't force redraw of my frame

Hi!
I want to show a blinking text over my derived CMDIChildWnd-class. The
blinking is done by one view which is hold by my frame. I set up a timer and
write text to the parent frame, which works fine. But I can't get the text
away the next time the timer fires. Here is some code:

void MyView::OnTimer(UINT nIDEvent)
{
if (nIDEvent!=1) return;
showText = !showText;
// Call base class handler.
CView::OnTimer(nIDEvent);

CUserFrame* frame = (CUserFrame*)(this->GetParentFrame());
CRect clientRect;
frame->GetClientRect(&clientRect);

if (showText){
// display the text --------- THIS WORKS FINE
CFont font;
CDC* dc = frame->GetDC();
font.CreatePointFont (720, _T ("Arial"));
CFont* oldFond = dc->SelectObject (&font);;
dc->SetBkMode (TRANSPARENT);
dc->SetTextColor(RGB(255,100,0));
dc->DrawText(_T("blink"), clientRect, DT_SINGLELINE | DT_CENTER |
DT_VCENTER);
dc->SelectObject (oldFond);
frame->ReleaseDC(dc);
}else{
// remove the text -------------- DOESN'T WORK

// here are many things I tried, but without success
::InvalidateRect(frame->m_hWnd,0,TRUE);
::InvalidateRect(frame->m_hWnd,&clientRect,TRUE);
::UpdateWindow(frame->m_hWnd);
frame->UnlockWindowUpdate();
frame->Invalidate(true);
frame->UpdateWindow();
frame->RedrawWindow();
frame->my2View->UnlockWindowUpdate(); /* my2View is anoter
view that the frame holds (It has a static splitter)*/
frame->my2View->InvalidateRect(&clientRect);
frame->my2View->Invalidate(true);
frame->my2View->UpdateWindow();
frame->my2View->RedrawWindow();
AfxGetMainWnd()->RedrawWindow();

/* To be sure that the code is working corect I added a drawText
here,
which is displayed correctly above the first text and is under
the "blink" after the next timer event */
CDC* dc = frame->GetDC();
dc->DrawText(_T("hello..."), clientRect, DT_SINGLELINE | DT_CENTER |
DT_VCENTER);
frame->ReleaseDC(dc);
}
}

So the result of the above code is that "blink" is written on my window,
then "hello" is written above it, than "blink" again... but the other text
will never be deleted.
Anyone any ideas why this is so, why the window is not redrawn, so the
"blink" should disapear, becaus it is not in the frames OnPaint()?

Thanks for any help
Maik
Nov 17 '05 #1
0 1412

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Marc | last post by:
Hi all, I have an application that uses a Pmw ComboBox to display a list that is dynamic. The user has the ability to add and delete items from the list at different points in the program. ...
2
by: Maik Wiege | last post by:
Hi! I want to show a blinking text over my derived CMDIChildWnd-class. The blinking is done by one view which is hold by my frame. I set up a timer and write text to the parent frame, which works...
4
by: Roberto | last post by:
Hi everyone, I'm new here... I have a frameset header/contents. It's necessary to force the header's scrollbar to be visible to preserve the alignment between the two frames (see...
3
by: Phil | last post by:
how do I force a window, pened alone, to be displayed in its frame set? tried this: if (parent.location.href == self.location.href) { window.location.href = '../'; } the problem is that...
20
by: Crirus | last post by:
I have a 20x16 array of objects. I need a way to iterate through the array and only consider few rows and few columns. To be clearer, sometimes I need only first 2 rows and last 3 columns to be...
2
by: Don | last post by:
Is there anyway to force an area of the desktop to redraw in VB.NET? - Don
3
by: beatdown | last post by:
Hi all, I have a set of Javascript functions that dinamically update the contents of a HTML <selectelement, depending on the value of another <select>. For easy understanding: I select a...
10
by: markwalker84 | last post by:
Hello everyone! Got a bit of a problem... Two of the panels on my program contain a number of check boxes. The exact number of which is determined by a pair of variables. I have recently...
0
by: adubra | last post by:
Hi there, I am using a device context (DC) and a buffer to successfully draw to screen. However, when I update the DC at very high frame rate and drag the frame containing the image very quickly...
2
by: dmc2409 | last post by:
Well, I am more a desigber than developer. Need to solve the folloving problem. I have a page on, lets call it Firstserver. It opens Page1, Page2 and Page3 on Secondserver through a frame on the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.