Hi there,

I'm porting an app to mobile 2003 using vs2005 and I have a dialog form with
a static text control. I am trying to change the text with...

SetDlgItemText(IDC_TEXT_MSG, _T("Is this working?"));

... and nothing happens.

The text remains what I have set using the caption property in the editor.

I tried this ...

GetDlgItem(IDC_TEXT_MSG)->SetWindowText(_T("Is this working?"));

and this too...

SetDlgItemText(IDC_TEXT_MSG, _T("Is this working?"));
GetDlgItem(IDC_TEXT_MSG)->UpdateWindow();

Nothing happens.

The docs say that SetDlgItemText is supposed to return a BOOL, but the one
I'm using is returning a void.

Any ideas?

Thanks in advance,
Andrew

Re: SetDlgItemText not working on mobile 2003 by andrew

andrew
Mon Nov 21 14:25:44 CST 2005

Ok, solved my own problem.

I was trying to change the text in the OnInitDialog method, and the static
window is probably not initialized itself, but if I change the text after
OnInitDialog is complete, the text changes.

Sorry for jumping the gum and thanks anyway!

"andrew" <nospam@nospam.com> wrote in message
news:eM4ZGet7FHA.4012@TK2MSFTNGP14.phx.gbl...
> Hi there,
>
> I'm porting an app to mobile 2003 using vs2005 and I have a dialog form
> with a static text control. I am trying to change the text with...
>
> SetDlgItemText(IDC_TEXT_MSG, _T("Is this working?"));
>
> ... and nothing happens.
>
> The text remains what I have set using the caption property in the editor.
>
> I tried this ...
>
> GetDlgItem(IDC_TEXT_MSG)->SetWindowText(_T("Is this working?"));
>
> and this too...
>
> SetDlgItemText(IDC_TEXT_MSG, _T("Is this working?"));
> GetDlgItem(IDC_TEXT_MSG)->UpdateWindow();
>
> Nothing happens.
>
> The docs say that SetDlgItemText is supposed to return a BOOL, but the one
> I'm using is returning a void.
>
> Any ideas?
>
> Thanks in advance,
> Andrew
>