Click here to Skip to main content
15,898,373 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Application freeze Pin
susanne129-Jun-09 0:36
susanne129-Jun-09 0:36 
AnswerRe: Application freeze Pin
Rajesh R Subramanian29-Jun-09 0:38
professionalRajesh R Subramanian29-Jun-09 0:38 
GeneralRe: Application freeze Pin
susanne129-Jun-09 0:52
susanne129-Jun-09 0:52 
GeneralRe: Application freeze Pin
Rajesh R Subramanian29-Jun-09 0:58
professionalRajesh R Subramanian29-Jun-09 0:58 
GeneralRe: Application freeze Pin
susanne129-Jun-09 1:45
susanne129-Jun-09 1:45 
GeneralRe: Application freeze Pin
Rajesh R Subramanian29-Jun-09 1:52
professionalRajesh R Subramanian29-Jun-09 1:52 
AnswerRe: Application freeze Pin
Michael Thärigen12-Sep-09 22:54
Michael Thärigen12-Sep-09 22:54 
Questiontimer start problem Pin
susanne129-Jun-09 0:25
susanne129-Jun-09 0:25 
Hallo,

I need to start a timer like the following to measure the time that my appliction requires to do someting:

void CMiniClass :: DoSomething()
{
theApp.m_pMainWnd ->SetTimer (MY_TIMER,1000,NULL);

while (i > 0)
{
DoStuff();
}
//theApp.m_pMainWnd ->KillTimer (MY_TIMER);
}

in the CMainFrame.cpp i overrode the OnTimer() from the baseclass:

void CMainFrame::OnTimer(UINT nIDEvent)
{
m_bFlagStartTimer = true;

CFrameWnd::OnTimer(nIDEvent);

CString strTimer(_T(""));

m_nSeconds++;

if(m_nSeconds == 60)
{
m_nMinutes++;
m_nSeconds = 0;
}

if(m_nMinutes == 60)
{
m_nHours++;
m_nMinutes = 0;
}

if(m_nHours == 24)
{
m_nHours = 0;
}

strTimer.Format("%d:%d:%d", m_nHours, m_nMinutes, m_nSeconds);

MessageBox(strTimer,0,0);
}

the problem is the application starts the Timer(in the Messagebox) after he finished the while-loop,so i can not know how long
my appliction was BUSY with this loop, and if i activate theApp.m_pMainWnd ->KillTimer (MY_TIMER);
the Timer would be KILLED and then the while-llop starts, i need to do this without using Thread.

Please help to fix this problem. Thanks.
AnswerRe: timer start problem Pin
«_Superman_»29-Jun-09 0:35
professional«_Superman_»29-Jun-09 0:35 
GeneralRe: timer start problem Pin
susanne129-Jun-09 0:57
susanne129-Jun-09 0:57 
AnswerRe: timer start problem Pin
Stuart Dootson29-Jun-09 0:39
professionalStuart Dootson29-Jun-09 0:39 
GeneralRe: timer start problem Pin
susanne129-Jun-09 1:15
susanne129-Jun-09 1:15 
GeneralRe: timer start problem Pin
Chandrasekharan P29-Jun-09 1:57
Chandrasekharan P29-Jun-09 1:57 
GeneralRe: timer start problem Pin
Stuart Dootson29-Jun-09 2:39
professionalStuart Dootson29-Jun-09 2:39 
QuestionCreateFile related Pin
ashish8patil29-Jun-09 0:07
ashish8patil29-Jun-09 0:07 
AnswerRe: CreateFile related Pin
Cedric Moonen29-Jun-09 0:16
Cedric Moonen29-Jun-09 0:16 
GeneralRe: CreateFile related Pin
ashish8patil29-Jun-09 0:23
ashish8patil29-Jun-09 0:23 
AnswerRe: CreateFile related Pin
«_Superman_»29-Jun-09 0:18
professional«_Superman_»29-Jun-09 0:18 
GeneralRe: CreateFile related Pin
ashish8patil29-Jun-09 0:28
ashish8patil29-Jun-09 0:28 
GeneralRe: CreateFile related Pin
«_Superman_»29-Jun-09 0:31
professional«_Superman_»29-Jun-09 0:31 
GeneralRe: CreateFile related Pin
ashish8patil29-Jun-09 0:36
ashish8patil29-Jun-09 0:36 
AnswerRe: CreateFile related Pin
Luc Pattyn29-Jun-09 0:20
sitebuilderLuc Pattyn29-Jun-09 0:20 
AnswerRe: CreateFile related Pin
Stuart Dootson29-Jun-09 0:32
professionalStuart Dootson29-Jun-09 0:32 
QuestionCDockablePane Autohide issue Pin
Harsh Shankar28-Jun-09 23:39
Harsh Shankar28-Jun-09 23:39 
Questionlist and ip control in mfc Pin
rahuljin28-Jun-09 23:37
rahuljin28-Jun-09 23:37 

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.