How i can display the time in TEXTBOX or LABEL ?
Printable View
How i can display the time in TEXTBOX or LABEL ?
Try this:
Code:LPSTR lpTime;
wsprintf(lpTime, "%s", __TIME__);
SetWindowText(hwndStatic, lpTime);
Don't you need a buffer?Code:char pcTime[100];
How can you be sure it won't write beyond the buffer array?
Thanx a lot.
I want to display date and time in lable using MFC.
Kedaman - use snprintf then (I think that's a function, otherwise just fake it with _vsnprintf ;)).
VB7 - look at the class documentation for the class your lable is derived from.
Hey, parksie, I don't get it, why would you implement a function that might crash your system without warning?
If you're worried about it, just use a very big buffer :)
Nah, I'd never be that stupid :p