Click here to Skip to main content
15,894,540 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: OOP is driving me crazy! Pin
KarstenK11-Dec-07 2:00
mveKarstenK11-Dec-07 2:00 
QuestionIs anybody to solve my probblem Pin
rajneshmalik10-Dec-07 22:19
rajneshmalik10-Dec-07 22:19 
GeneralRe: Is anybody to solve my probblem Pin
Nelek10-Dec-07 23:42
protectorNelek10-Dec-07 23:42 
GeneralLoading an ICON from a file Pin
eli1502197910-Dec-07 22:18
eli1502197910-Dec-07 22:18 
GeneralRe: Loading an ICON from a file Pin
CPallini10-Dec-07 22:42
mveCPallini10-Dec-07 22:42 
GeneralRe: Loading an ICON from a file Pin
eli1502197910-Dec-07 22:54
eli1502197910-Dec-07 22:54 
GeneralRe: Loading an ICON from a file Pin
Naveen10-Dec-07 23:25
Naveen10-Dec-07 23:25 
QuestionRe: Loading an ICON from a file Pin
Hamid_RT11-Dec-07 0:02
Hamid_RT11-Dec-07 0:02 
GeneralMAPI to MIME Pin
monsieur_jj10-Dec-07 21:40
monsieur_jj10-Dec-07 21:40 
QuestionProblem in opening the HTML file. Pin
sanjeeva K Kanakam10-Dec-07 21:30
sanjeeva K Kanakam10-Dec-07 21:30 
GeneralRe: Problem in opening the HTML file. Pin
Christian Graus10-Dec-07 22:19
protectorChristian Graus10-Dec-07 22:19 
QuestionRe: Problem in opening the HTML file. Pin
Hamid_RT11-Dec-07 0:02
Hamid_RT11-Dec-07 0:02 
GeneralRe: Problem in opening the HTML file. Pin
sanjeeva K Kanakam11-Dec-07 20:09
sanjeeva K Kanakam11-Dec-07 20:09 
GeneralRe: Problem in opening the HTML file. Pin
Hamid_RT14-Dec-07 18:39
Hamid_RT14-Dec-07 18:39 
GeneralVirtual Inheritance Pin
Nik123410-Dec-07 21:25
Nik123410-Dec-07 21:25 
GeneralRe: Virtual Inheritance Pin
Cedric Moonen10-Dec-07 21:33
Cedric Moonen10-Dec-07 21:33 
GeneralRe: Virtual Inheritance Pin
Nik123411-Dec-07 1:07
Nik123411-Dec-07 1:07 
GeneralRe: Virtual Inheritance Pin
Cedric Moonen11-Dec-07 1:33
Cedric Moonen11-Dec-07 1:33 
GeneralRe: Virtual Inheritance Pin
Nik123411-Dec-07 1:55
Nik123411-Dec-07 1:55 
Question[Done, may not good enough] GDI+ How to set a region without its constructor? Pin
followait10-Dec-07 20:43
followait10-Dec-07 20:43 
AnswerRe: [Done, may not good enough] GDI+ How to set a region without its constructor? Pin
Mark Salsbery11-Dec-07 6:15
Mark Salsbery11-Dec-07 6:15 
GeneralDeny Taking Ownership Pin
narayanagvs10-Dec-07 19:52
narayanagvs10-Dec-07 19:52 
GeneralProblem using sleep function. [modified] Pin
nitin310-Dec-07 19:21
nitin310-Dec-07 19:21 
//iam tring to show progressdialog on click ok button on Main dialog and update the WindowCaption in an interval of 1 sec. my problem described below..

HWND hWnd ;

void  ProgressFunc(HWND hwnd , char* progress )
{	
   SetWindowText( hWnd , progress ) ;

  <font color="green">//Update progress text by changing window title  </font>
}


DWORD MyProgressDlgThread(LPVOID Nothing )
{
    DialogBox(hInst,MAKEINTRESOURCE(IDD_PROGDLG1), ... ) ;
    <font color="green">//i set the value of global hWnd on InitDialog function of this window.</font>

return 0 ;
}


MyMainDialog_OkClick()
{
hWnd = NULL ;
char data[ 3 ] ;

	HANDLE hTread = CreateThread( ... , (LPTHREAD_START_ROUTINE)MyProgressDlgThread , (LPVOID)NULL , ... ) ;
	int i = 0 , n = 10 ;
	while( i < n )
	{
		if( hWnd )
		{		
			sprintf( data ,"%d" ,  i ) ;
			ProgressFunc( hWnd , data ) ; 
		}
		Sleep( 1000 ) ;
	};

}



my problem is,
the dialogbox shown only after 2-3 seconds and the value is updated only once. how to

solve this problem ?

i cant use a timer here for some reason.

plz help me

Thanks & Regards

modified on Tuesday, December 11, 2007 2:18:28 AM

GeneralRe: Problem using sleep function. Pin
Llasus10-Dec-07 20:11
Llasus10-Dec-07 20:11 
GeneralRe: Problem using sleep function. Pin
Llasus10-Dec-07 20:53
Llasus10-Dec-07 20:53 

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.