473,602 Members | 2,792 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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*)(t his->GetParentFrame ());
CRect clientRect;
frame->GetClientRect( &clientRect) ;

if (showText){
// display the text --------- THIS WORKS FINE
CFont font;
CDC* dc = frame->GetDC();
font.CreatePoin tFont (720, _T ("Arial"));
CFont* oldFond = dc->SelectObject (&font);;
dc->SetBkMode (TRANSPARENT);
dc->SetTextColor(R GB(255,100,0));
dc->DrawText(_T("b link"), 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
::InvalidateRec t(frame->m_hWnd,0,TRUE) ;
::InvalidateRec t(frame->m_hWnd,&client Rect,TRUE);
::UpdateWindow( frame->m_hWnd);
frame->UnlockWindowUp date();
frame->Invalidate(tru e);
frame->UpdateWindow() ;
frame->RedrawWindow() ;
frame->my2View->UnlockWindowUp date(); /* my2View is anoter
view that the frame holds (It has a static splitter)*/
frame->my2View->InvalidateRect (&clientRect) ;
frame->my2View->Invalidate(tru e);
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("h ello..."), 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
Jul 22 '05 #1
2 3435
"Maik Wiege" <mi*****@gmx.de > wrote in message
news:bu******** *****@news.t-online.com...
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:


This is a very advanced subject. We cannot help you here. You should
post in a newsgroup devoted to blinking text.

Jonathan
Jul 22 '05 #2
Jonathan Turkanis wrote:
"Maik Wiege" <mi*****@gmx.de > wrote in message
news:bu******** *****@news.t-online.com...
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:

This is a very advanced subject. We cannot help you here. You should
post in a newsgroup devoted to blinking text.


Actually, we can't help you here because it is and MFC question.
Go to a VisualC newsgroup.

:)

Jorge L.

Jonathan

Jul 22 '05 #3

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

Similar topics

0
2110
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. However, once the list is updated it needs to automatically refresh the ComboBox to reflect the updated list. The only way I have been able to solve the problem so far is to redraw the window (by withdrawing the window and calling the function that...
3
2706
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 the original page is replaced by the main.htm page (the default page for the 'main' frame)., because the open event of the menu page
0
1422
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 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;
20
1393
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 considered in loop Another time, I whould need only first 3 columns and last 4 rows to be considered... Anyhow, I will not have separate rows or columns in the same iteration...
2
1817
by: Don | last post by:
Is there anyway to force an area of the desktop to redraw in VB.NET? - Don
3
3221
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 region/state in one <selectand then I update the list of towns in that region in the other <select>. Some regions have lots of towns and there is a little wait until the browser updates completely the <select>. I want to show a "Loading..." message,...
10
35901
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 implemented a Wizard which changes that number, as well as a save and load function to the program. I know the number of being altered in memory (i added a quick check button) but what i'm struggling with is how to refresh the panel with the new...
0
2458
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 over the screen or I drag another window on top of the fast display, I get errors (Pyassertion ....). I believe those are related to a conflict between the thread that is updating the buffer (over which I have control) and the thread that is doing the...
2
2407
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 mainpage of the Firstserver. I have big problems with refreshing content of the pages on the Secondserver. I need a way to delete session cookies of the pages on the Secondserver ON FIRSTSERVER'S MAINPAGE UNLOAD... and force Secondserver pages...
0
8401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8404
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8054
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8268
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6730
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5867
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3900
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3944
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2418
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.