visual studio 2010 - Progress bar not updating in Win32 -
i create progress bar in win32 , not update when i'm building application in release configuration works in debug configuration. progress bar created follows:
progbar= createwindowex(0,progress_class,null,ws_child | ws_visible|pbs_smooth,rc.right/2-130,rc.bottom/2, 260, 17,hwnd, null, hinst, null); //sets range of progress bar sendmessage(progbar, pbm_setrange, 0, makelparam(0,10)); //0->min value; 10->max value settimer(hwnd, timer_1, 1000, timerproc); //set timer
and timerproc :
void callback timerproc(hwnd hwnd, uint msg, uint idevent, dword dwtime) { switch(msg) { case wm_timer: { sendmessage(progbar, pbm_setpos,stepvalue,0); //stepvalue invalidaterect(progbar,null,true); if(stepvalue>9) { stepvalue=0; } else { stepvalue++; } } } return; }
i'm using visual studio 2010.is possible i'm missing library since works in debug configuration. runtime library i've selected multi-threaded (/mt)
according hans tried marquee style progress bar , worked. code change follows:
progbar= createwindowex(0,progress_class,null,ws_child | ws_visible|pbs_marquee,rc.right/2-130,rc.bottom/2, 260, 17,hwnd, null, hinst, null); sendmessage(progbar, pbm_setmarquee,true,50);
and removed setrange statement.according link
i had add
#pragma comment(linker,"/manifestdependency:\"type='win32' name='microsoft.windows.common-controls' version='6.0.0.0' processorarchitecture='x86' publickeytoken='6595b64144ccf1df' language='*'\"")
else marquee progress bar not work. 1 explain this? works me on release builds well.
Comments
Post a Comment