Click here to Skip to main content
15,923,168 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
JokeRe: Using MFC class in a native application Pin
Rajesh R Subramanian14-May-08 1:05
professionalRajesh R Subramanian14-May-08 1:05 
QuestionRe: Using MFC class in a native application Pin
David Crow14-May-08 3:16
David Crow14-May-08 3:16 
QuestionDrawing child controls in MetaFile Pin
sv1413-May-08 20:21
sv1413-May-08 20:21 
AnswerRe: Drawing child controls in MetaFile Pin
ShilpiP13-May-08 21:27
ShilpiP13-May-08 21:27 
GeneralRe: Drawing child controls in MetaFile Pin
sv1413-May-08 23:47
sv1413-May-08 23:47 
GeneralRe: Drawing child controls in MetaFile Pin
ShilpiP14-May-08 1:01
ShilpiP14-May-08 1:01 
GeneralRe: Drawing child controls in MetaFile Pin
sv1414-May-08 18:55
sv1414-May-08 18:55 
QuestionHow Can Get SystemTime? Pin
Le@rner13-May-08 19:45
Le@rner13-May-08 19:45 
Hi all,

i want to know how can i get SystemTime?

i m using CTime class for get time, but it show the time of computer clock which is shown at below right side in start up.

<br />
	CTime time = CTime::GetCurrentTime();<br />
	int nSecond = time.GetSecond();<br />
	<br />
	if (tTime != nSecond)<br />
	{<br />
		CTime time = CTime::GetCurrentTime();<br />
		int nSecond = time.GetSecond();<br />
		int nMinute = time.GetMinute();<br />
		int nHour   = time.GetHour();<br />
		int nday	= time.GetDay();<br />
		int nmnt	= time.GetMonth();<br />
		int nyear	= time.GetYear();<br />
<br />
		if (nHour > 12)<br />
			nHour -= 12;<br />
CString szStr;<br />
szStr.Format("%.2d,%.2d,%.2d %.2d:%.2d:%.2d ", nmnt , nday , nyear , nHour , nMinute , nSecond);<br />
CEdit m_clock_edit;//variable of edit box where i show the clock<br />
m_clock_edit.SetWindowTextA(szStr);<br />
<br />
	}<br />
	tTime = nSecond;<br />


if i change the time and date here then in my applicatin i m also gat the changed time but i want to get the SystemTime of Machine.

i want if i change the date and time in computer clock ,then it is not effect on my application.

thanks in advance.

IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH

AnswerRe: How Can Get SystemTime? Pin
ShilpiP13-May-08 20:01
ShilpiP13-May-08 20:01 
GeneralRe: How Can Get SystemTime? Pin
Le@rner13-May-08 20:09
Le@rner13-May-08 20:09 
GeneralRe: How Can Get SystemTime? [modified] Pin
Le@rner13-May-08 20:18
Le@rner13-May-08 20:18 
GeneralRe: How Can Get SystemTime? Pin
ShilpiP13-May-08 20:46
ShilpiP13-May-08 20:46 
GeneralRe: How Can Get SystemTime? Pin
Le@rner13-May-08 21:03
Le@rner13-May-08 21:03 
GeneralRe: How Can Get SystemTime? Pin
ShilpiP13-May-08 21:13
ShilpiP13-May-08 21:13 
QuestionGetting problem in writing windows service [ ERROR 1053 ] [modified] Pin
Soumyadipta13-May-08 19:43
Soumyadipta13-May-08 19:43 
AnswerRe: Getting problem in writing windows service [ ERROR 1053 ] Pin
Rajkumar R13-May-08 23:52
Rajkumar R13-May-08 23:52 
AnswerRe: Getting problem in writing windows service [ ERROR 1053 ] Pin
Soumyadipta14-May-08 1:27
Soumyadipta14-May-08 1:27 
GeneralRe: Getting problem in writing windows service [ ERROR 1053 ] Pin
Iain Clarke, Warrior Programmer14-May-08 1:53
Iain Clarke, Warrior Programmer14-May-08 1:53 
GeneralRe: Getting problem in writing windows service [ ERROR 1053 ] Pin
Soumyadipta14-May-08 2:47
Soumyadipta14-May-08 2:47 
GeneralRe: Getting problem in writing windows service [ ERROR 1053 ] Pin
netprotector31-Mar-09 20:08
netprotector31-Mar-09 20:08 
AnswerRe: Getting problem in writing windows service [ ERROR 1053 ] Pin
Soumyadipta14-May-08 4:23
Soumyadipta14-May-08 4:23 
QuestionMFC application crashes @ ConnectionTransact of DBNMPNTW.DLL Pin
Arun Kuriyakkotte Ramachandran13-May-08 19:13
Arun Kuriyakkotte Ramachandran13-May-08 19:13 
AnswerRe: MFC application crashes @ ConnectionTransact of DBNMPNTW.DLL Pin
kasturi_haribabu13-May-08 19:25
kasturi_haribabu13-May-08 19:25 
QuestionApplication gets slower when having ~50 dialogs in memory. Pin
Paresh Chitte13-May-08 19:07
Paresh Chitte13-May-08 19:07 
AnswerRe: Application gets slower when having ~50 dialogs in memory. Pin
Steve Echols13-May-08 19:26
Steve Echols13-May-08 19:26 

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.