Click to See Complete Forum and Search --> : SetDlgText noob question-


irb4
September 20th, 2006, 09:17 AM
I open a dialog box in CE.


a)static short text[] = "13232343"

SetDlgText(blah, blah, text);

And found a couple of boxes on my Juniper output.

Bad.

b)read up c book and saw at end of string need /0, like this

static char text[3];
text[0]=1;text[1]=32; t[2]=0;

SetDlgText(blah, blah, text);

a couple of boxes.

c)ok like this

SetDlgText(blah, blah, TEXT("12423");

works.


****

My question is:

If I want to display a variable, say x, that changes every second,
how do i do that using SetDlgText?


int x = time();

definitely not like this SetDlgTexdt(blah, blah, TEXT("x");



I know, I know, pretty stupid, but I have spent a long time trying to tweak, any help will be appreciated.

THanks!


PS or any alternative function? I just want to display dinamic variable on a dialog.

golanshahar
September 20th, 2006, 12:50 PM
Not sure i understood your question but if you want to display int you can use: ::SetDlgItemInt() (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/dialogboxes/dialogboxreference/dialogboxfunctions/setdlgitemint.asp).

Cheers

kirants
September 20th, 2006, 03:40 PM
As far as I know, WinCE uses UNICODE text only for controls.

So, try this:

static TCHAR text[] = _T("13232343");
SetDlgText(blah, blah, text);

irb4
September 20th, 2006, 10:04 PM
You guys are the greatest. Saved me. Muah!