GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 25-Mar-2005, 09:43
Rabbit_May Rabbit_May is offline
New Member
 
Join Date: Mar 2005
Posts: 1
Rabbit_May is on a distinguished road
Lightbulb

update view from a for loop


Dear all,

I have a document and a view, in the view class, I have a function like this:
CPP / C++ / C Code:
int i = 0; //global
int Num = 10;
void CTt3View::OnDraw(CDC* pDC){
    CString str;
    str.Format("Num: %d", Num);
    int x = 100;
    int y = i * 100;
    pDC->TextOut(x, y, str);
}

void CTt3View::OndialogButton() {
   for(i = 0; i < 3; i++)
   {
        Num += Num * 10;
       //here I want to call the OnDraw() function to update     
   }
}

does anyone know how to update the view? I tried the RedrawWindow() it only gives me the last Text, which means it only shows the last number which is Num3. it does not show the Num1 and Num2, does anyone know how to update the view?
I want
when i = 0: (output on view): Num = 100
when i = 1: (output on view): Num = 100
Num = 1100
when i = 2: (output on view): Num = 100
Num = 1100
Num = 12100
Thank you very much in advance!
Last edited by admin : 07-Nov-2005 at 15:26. Reason: Please insert your C++ code between [c++] & [/c++] tags
 
 

Recent GIDBlogToyota - 2008 September Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A view with tabs CaptnB MS Visual C++ / MFC Forum 1 06-Feb-2005 02:42
Class dissapear from Class view tab acsinha MS Visual C++ / MFC Forum 3 30-Dec-2004 20:46
Help! Some basal questions about MFC xutingnjupt MS Visual C++ / MFC Forum 1 05-Dec-2004 03:38
RE: A simple update and } problem Dagma20 MySQL / PHP Forum 3 27-Mar-2004 16:37
Google Update and DeepCrawl Alert JdS Search Engine Optimization Forum 24 16-Aug-2003 05:35

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 06:33.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.