Click here to Skip to main content
16,012,611 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: about parameter passing Pin
David Crow20-Mar-08 2:28
David Crow20-Mar-08 2:28 
AnswerRe: about parameter passing Pin
savitri20-Mar-08 21:17
savitri20-Mar-08 21:17 
GeneralRe: about parameter passing Pin
David Crow21-Mar-08 2:53
David Crow21-Mar-08 2:53 
Questionhow to pause execution on a form based application without Sleep() effect Pin
reteset18-Mar-08 23:07
reteset18-Mar-08 23:07 
GeneralRe: how to pause execution on a form based application without Sleep() effect Pin
Cedric Moonen18-Mar-08 23:10
Cedric Moonen18-Mar-08 23:10 
GeneralRe: how to pause execution on a form based application without Sleep() effect Pin
reteset18-Mar-08 23:32
reteset18-Mar-08 23:32 
GeneralRe: how to pause execution on a form based application without Sleep() effect Pin
Mark Salsbery19-Mar-08 8:41
Mark Salsbery19-Mar-08 8:41 
GeneralRe: how to pause execution on a form based application without Sleep() effect Pin
Randor 19-Mar-08 3:37
professional Randor 19-Mar-08 3:37 
One technique that sometimes works is simply pumping the message que while waiting.
void YourClass::somefunc()
{
	SetWindowText(hWnd,"hello");
	SleepWithEvents(5000); 
	SetWindowText(hWnd,"good bye");
}

VOID YourClass::SleepWithEvents(int Millisecs)
{
	ULONG Ticks = GetTickCount();
	while(GetTickCount() < Ticks + Millisecs)
		DoEvents();
}

VOID YourClass::DoEvents()
{
	MSG oMSG;
	while(::PeekMessage(&oMSG, NULL, 0, 0, PM_NOREMOVE))
	{
		if(::GetMessage(&oMSG, NULL, 0, 0))
		{
			::TranslateMessage(&oMSG);
			::DispatchMessage(&oMSG);
		}
		else
		{
			break;
		}
	}
}


Best Wishes,

-David Delaune
GeneralRe: how to pause execution on a form based application without Sleep() effect Pin
ThatsAlok19-Mar-08 19:51
ThatsAlok19-Mar-08 19:51 
GeneralRe: how to pause execution on a form based application without Sleep() effect Pin
reteset21-Mar-08 7:40
reteset21-Mar-08 7:40 
GeneralModeless dialog box Pin
Chandrasekharan P18-Mar-08 22:57
Chandrasekharan P18-Mar-08 22:57 
GeneralRe: Modeless dialog box Pin
Cedric Moonen18-Mar-08 23:05
Cedric Moonen18-Mar-08 23:05 
GeneralRe: Modeless dialog box Pin
Chandrasekharan P18-Mar-08 23:20
Chandrasekharan P18-Mar-08 23:20 
GeneralRe: Modeless dialog box Pin
Cedric Moonen18-Mar-08 23:46
Cedric Moonen18-Mar-08 23:46 
GeneralRe: Modeless dialog box Pin
CPallini19-Mar-08 0:24
mveCPallini19-Mar-08 0:24 
JokeRe: Modeless dialog box Pin
Cedric Moonen19-Mar-08 0:33
Cedric Moonen19-Mar-08 0:33 
JokeRe: Modeless dialog box Pin
Rajesh R Subramanian19-Mar-08 1:19
professionalRajesh R Subramanian19-Mar-08 1:19 
GeneralRe: Modeless dialog box Pin
Cedric Moonen19-Mar-08 1:38
Cedric Moonen19-Mar-08 1:38 
GeneralRe: Modeless dialog box Pin
CPallini19-Mar-08 2:10
mveCPallini19-Mar-08 2:10 
GeneralRe: Modeless dialog box Pin
Rajesh R Subramanian19-Mar-08 2:15
professionalRajesh R Subramanian19-Mar-08 2:15 
GeneralSure. Pin
CPallini19-Mar-08 3:03
mveCPallini19-Mar-08 3:03 
GeneralRe: Modeless dialog box Pin
SandipG 19-Mar-08 8:32
SandipG 19-Mar-08 8:32 
GeneralRe: Modeless dialog box Pin
rp_suman19-Mar-08 16:38
rp_suman19-Mar-08 16:38 
GeneralPrinting Multiple Copies in MFC Pin
softwaremonkey18-Mar-08 22:45
softwaremonkey18-Mar-08 22:45 
GeneralRe: Printing Multiple Copies in MFC Pin
Iain Clarke, Warrior Programmer18-Mar-08 22:59
Iain Clarke, Warrior Programmer18-Mar-08 22:59 

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.