Click here to Skip to main content
15,887,812 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: How can I display current time in dialog static control Pin
amistry_petlad5-Jun-08 6:38
amistry_petlad5-Jun-08 6:38 
AnswerRe: How can I display current time in dialog static control Pin
David Crow5-Jun-08 6:43
David Crow5-Jun-08 6:43 
GeneralRe: How can I display current time in dialog static control Pin
amistry_petlad5-Jun-08 7:07
amistry_petlad5-Jun-08 7:07 
GeneralRe: How can I display current time in dialog static control Pin
David Crow5-Jun-08 7:23
David Crow5-Jun-08 7:23 
GeneralRe: How can I display current time in dialog static control Pin
amistry_petlad5-Jun-08 7:44
amistry_petlad5-Jun-08 7:44 
GeneralRe: How can I display current time in dialog static control Pin
David Crow5-Jun-08 7:56
David Crow5-Jun-08 7:56 
GeneralRe: How can I display current time in dialog static control Pin
amistry_petlad5-Jun-08 9:25
amistry_petlad5-Jun-08 9:25 
GeneralRe: How can I display current time in dialog static control Pin
Jijo.Raj5-Jun-08 9:12
Jijo.Raj5-Jun-08 9:12 
amistry_petlad wrote:
sprintf_s(str,"02d%:02d%:02d%",time.wHour,time.wMinute,time.wSecond);


The format string is "02d%:02d%:02d%" or "%02d:%02d:%02d" ? Wink | ;) Need to brushup those old C lessons? Big Grin | :-D

BTW, Why can't you use CString?

SYSTEMTIME time;
GetLocalTime(&time);

CString csTime;
csTime.Format( _T("%02d:%02d:%02d"), time.wHour,time.wMinute,time.wSecond );

SetDlgItemText(IDC_STATIC1,csTime);


I apoligize that since i don't have VS2008 installed, the above code snippet is compiled in VS6.0. So try it.

Regards,
Jijo.

_____________________________________________________

http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

GeneralRe: How can I display current time in dialog static control Pin
amistry_petlad5-Jun-08 11:02
amistry_petlad5-Jun-08 11:02 
JokeRe: How can I display current time in dialog static control Pin
Jijo.Raj5-Jun-08 18:31
Jijo.Raj5-Jun-08 18:31 
GeneralRe: How can I display current time in dialog static control Pin
SandipG 5-Jun-08 23:40
SandipG 5-Jun-08 23:40 
QuestionRe: How can I display current time in dialog static control Pin
Maximilien5-Jun-08 7:45
Maximilien5-Jun-08 7:45 
AnswerRe: How can I display current time in dialog static control Pin
amistry_petlad5-Jun-08 7:51
amistry_petlad5-Jun-08 7:51 
QuestionRe: How can I display current time in dialog static control Pin
messages5-Jun-08 5:35
messages5-Jun-08 5:35 
AnswerRe: How can I display current time in dialog static control Pin
amistry_petlad5-Jun-08 7:53
amistry_petlad5-Jun-08 7:53 
GeneralRe: How can I display current time in dialog static control Pin
Hamid_RT6-Jun-08 1:13
Hamid_RT6-Jun-08 1:13 
QuestionConvert to BW Pin
vandana75-Jun-08 5:03
vandana75-Jun-08 5:03 
AnswerRe: Convert to BW Pin
enhzflep5-Jun-08 17:06
enhzflep5-Jun-08 17:06 
GeneralRe: Convert to BW Pin
Nibu babu thomas5-Jun-08 17:19
Nibu babu thomas5-Jun-08 17:19 
GeneralRe: Convert to BW Pin
enhzflep5-Jun-08 17:35
enhzflep5-Jun-08 17:35 
GeneralRe: Convert to BW Pin
Nibu babu thomas5-Jun-08 17:37
Nibu babu thomas5-Jun-08 17:37 
QuestionBHO failing in Windows 2003 Server Pin
tony_Udz5-Jun-08 3:34
tony_Udz5-Jun-08 3:34 
AnswerRe: BHO failing in Windows 2003 Server Pin
led mike5-Jun-08 4:27
led mike5-Jun-08 4:27 
GeneralRe: BHO failing in Windows 2003 Server Pin
tony_Udz5-Jun-08 20:56
tony_Udz5-Jun-08 20:56 
GeneralRe: BHO failing in Windows 2003 Server Pin
led mike6-Jun-08 4:56
led mike6-Jun-08 4:56 

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.