Click here to Skip to main content
15,903,033 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Eclipse C++ Project references Pin
CPallini12-Feb-09 2:17
mveCPallini12-Feb-09 2:17 
GeneralRe: Eclipse C++ Project references [modified] Pin
gvanto12-Feb-09 12:16
gvanto12-Feb-09 12:16 
AnswerRe: Eclipse C++ Project references Pin
gvanto12-Feb-09 13:31
gvanto12-Feb-09 13:31 
Questionmessage loop + event Pin
Vlasta_12-Feb-09 0:16
Vlasta_12-Feb-09 0:16 
AnswerRe: message loop + event Pin
Stuart Dootson12-Feb-09 0:33
professionalStuart Dootson12-Feb-09 0:33 
AnswerRe: message loop + event Pin
Stephen Hewitt12-Feb-09 0:44
Stephen Hewitt12-Feb-09 0:44 
AnswerRe: message loop + event Pin
Vlasta_12-Feb-09 1:46
Vlasta_12-Feb-09 1:46 
QuestionBest sleep() method in while loop? Pin
notiter12-Feb-09 0:15
notiter12-Feb-09 0:15 
My application freezes after my while loop is in effect. The thing is everything in the while loop executes while the gui remains frozen and windows saying the application is not responding. Cpu usage is at 3% and its still executing properly, its just that the gui is frozen! I cant click my button which resets activeR to false thus ending the loop!

I first tried a simple Sleep(5000) at the end of the while loop, but that ended up with 100% cpu usage.
So i looked up on t_time and worked this out... like i said, it works... but the gui freezes. It still executes the keypress every 5 seconds though.

void roger()
{
	int count = 5;
	time_t seconds;
	time_t curseconds;
	bool seq = false;
	curseconds = time (NULL) + count;
	while(activeR){
		if(activeR && seq){
			curseconds = time (NULL) + count;
			numRogers = numRogers + 1;
			keybd_event(VK_PRIOR, 0xc9, 0, 0);
			keybd_event(VK_PRIOR, 0xc9, KEYEVENTF_KEYUP, 0);
			seq = false;
		}else{
			seconds = time (NULL);
			if(seconds >= curseconds)
			{
				seq = true;
			}
		}
		Sleep(1);
	}
}

AnswerRe: Best sleep() method in while loop? Pin
_AnsHUMAN_ 12-Feb-09 0:26
_AnsHUMAN_ 12-Feb-09 0:26 
AnswerRe: Best sleep() method in while loop? Pin
Eytukan12-Feb-09 0:38
Eytukan12-Feb-09 0:38 
AnswerRe: Best sleep() method in while loop? Pin
Roger Stoltz12-Feb-09 1:30
Roger Stoltz12-Feb-09 1:30 
GeneralRe: Best sleep() method in while loop? Pin
Eytukan12-Feb-09 2:25
Eytukan12-Feb-09 2:25 
GeneralRe: Best sleep() method in while loop? Pin
Roger Stoltz12-Feb-09 2:40
Roger Stoltz12-Feb-09 2:40 
AnswerRe: Best sleep() method in while loop? Pin
Rajesh R Subramanian12-Feb-09 3:33
professionalRajesh R Subramanian12-Feb-09 3:33 
GeneralRe: Best sleep() method in while loop? Pin
Roger Stoltz12-Feb-09 4:02
Roger Stoltz12-Feb-09 4:02 
GeneralRe: Best sleep() method in while loop? Pin
Rajesh R Subramanian12-Feb-09 4:46
professionalRajesh R Subramanian12-Feb-09 4:46 
GeneralRe: Best sleep() method in while loop? Pin
Eytukan12-Feb-09 6:05
Eytukan12-Feb-09 6:05 
QuestionSplitter window with RichEditView Pin
gopalraja12-Feb-09 0:06
gopalraja12-Feb-09 0:06 
AnswerRe: Splitter window with RichEditView Pin
Stuart Dootson12-Feb-09 0:31
professionalStuart Dootson12-Feb-09 0:31 
QuestionHow do we Inherit struct from another struct in IDL file Pin
Gopal_Kanchana11-Feb-09 23:44
Gopal_Kanchana11-Feb-09 23:44 
AnswerRe: How do we Inherit struct from another struct in IDL file Pin
CPallini12-Feb-09 0:09
mveCPallini12-Feb-09 0:09 
GeneralRe: How do we Inherit struct from another struct in IDL file Pin
Gopal_Kanchana12-Feb-09 0:18
Gopal_Kanchana12-Feb-09 0:18 
GeneralRe: How do we Inherit struct from another struct in IDL file Pin
CPallini12-Feb-09 0:30
mveCPallini12-Feb-09 0:30 
Questionstring replacement using c preprocessor Pin
tarcairion11-Feb-09 22:43
tarcairion11-Feb-09 22:43 
AnswerRe: string replacement using c preprocessor Pin
Iain Clarke, Warrior Programmer11-Feb-09 22:52
Iain Clarke, Warrior Programmer11-Feb-09 22:52 

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.