Click here to Skip to main content
16,010,553 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Logo on a dialog app Pin
Ryan Binns10-Apr-06 18:37
Ryan Binns10-Apr-06 18:37 
AnswerRe: Logo on a dialog app Pin
Krishnatv10-Apr-06 19:22
Krishnatv10-Apr-06 19:22 
AnswerRe: Logo on a dialog app Pin
Ștefan-Mihai MOGA11-Apr-06 0:09
professionalȘtefan-Mihai MOGA11-Apr-06 0:09 
Questionwindow update Pin
pnpfriend10-Apr-06 7:27
pnpfriend10-Apr-06 7:27 
AnswerRe: window update Pin
Ravi Bhavnani10-Apr-06 7:41
professionalRavi Bhavnani10-Apr-06 7:41 
QuestionRe: window update Pin
David Crow10-Apr-06 8:19
David Crow10-Apr-06 8:19 
AnswerRe: window update Pin
pnpfriend10-Apr-06 8:56
pnpfriend10-Apr-06 8:56 
GeneralRe: window update Pin
David Crow10-Apr-06 9:04
David Crow10-Apr-06 9:04 
pnpfriend wrote:
Isn't ::UpdateWindow(m_hWnd) solution to this?


Not hardly.

pnpfriend wrote:
What am I doing wrong?


You need to create two CStatic variables, one for each control. Make sure the DoDataExchange() method is correct:

void CMyDialog::DoDataExchange(CDataExchange* pDX)
{
    CDialog::DoDataExchange(pDX);
    //{{AFX_DATA_MAP(CMyDialog)
    DDX_Control(pDX, IDC_STATIC1, m_static1);
    DDX_Control(pDX, IDC_STATIC2, m_static2);
    //}}AFX_DATA_MAP
}
Now when you need to update them, simply call SetWindowText() like:

int nCounter = 1; // 2, 3, 4, 5
CString strCounter;
strCounter.Format("%d", nCounter);
m_static1.SetWindowText(strCounter);



"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

"There is no death, only a change of worlds." - Native American Proverb


GeneralRe: window update Pin
pnpfriend10-Apr-06 10:22
pnpfriend10-Apr-06 10:22 
GeneralRe: window update Pin
Michael Dunn10-Apr-06 11:10
sitebuilderMichael Dunn10-Apr-06 11:10 
GeneralRe: window update Pin
pnpfriend10-Apr-06 12:24
pnpfriend10-Apr-06 12:24 
Questionhow to give the buuttons a color? Pin
hektor kashuri10-Apr-06 7:14
hektor kashuri10-Apr-06 7:14 
AnswerRe: how to give the buuttons a color? Pin
Chris Losinger10-Apr-06 7:21
professionalChris Losinger10-Apr-06 7:21 
AnswerRe: how to give the buuttons a color? Pin
CodeVarma10-Apr-06 16:52
CodeVarma10-Apr-06 16:52 
AnswerRe: how to give the buuttons a color? Pin
Ryan Binns10-Apr-06 18:39
Ryan Binns10-Apr-06 18:39 
AnswerRe: how to give the buuttons a color? Pin
Ștefan-Mihai MOGA11-Apr-06 0:16
professionalȘtefan-Mihai MOGA11-Apr-06 0:16 
Questionhow to give the buuttons a color? Pin
hektor kashuri10-Apr-06 6:35
hektor kashuri10-Apr-06 6:35 
AnswerRe: how to give the buuttons a color? Pin
toxcct10-Apr-06 6:41
toxcct10-Apr-06 6:41 
AnswerRe: how to give the buuttona a color? Pin
Hamid_RT10-Apr-06 6:44
Hamid_RT10-Apr-06 6:44 
AnswerRe: how to give the buuttons a color? Pin
Ravi Bhavnani10-Apr-06 7:39
professionalRavi Bhavnani10-Apr-06 7:39 
Question(u_char *) Pin
idineen10-Apr-06 6:22
idineen10-Apr-06 6:22 
AnswerRe: (u_char *) Pin
toxcct10-Apr-06 6:30
toxcct10-Apr-06 6:30 
GeneralRe: (u_char *) Pin
idineen10-Apr-06 7:56
idineen10-Apr-06 7:56 
GeneralRe: (u_char *) Pin
koothkeeper10-Apr-06 9:40
professionalkoothkeeper10-Apr-06 9:40 
GeneralRe: (u_char *) Pin
Ryan Binns10-Apr-06 18:43
Ryan Binns10-Apr-06 18:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.