|
| Hi Every one,
I am new to this forum and to Windows CE. I like to include the progress control into my application for that i used timer to increase the progress bar and decrease as it reaches the top. The problem which I am facing is, the movement of the progress bar is strucking sometime or the progress bar movement is not smooth, even sometimes the bar movement is flashing. I want the progress bar to be increased and decreased in regular interval in smooth fashion. Can any one help me out to solve this issue for me.
I am using Single board computer connected with PXA270 processor.
If there is any sample code I really appreciate your interest.
Looking forward to hear from you ASAP.
Thanks & Regards,
gan | |
| |
H/PC Sensei Posts: | 1,330 |
Location: | North of England | Status: | |
| How are you updating the progress bar?
There's sample code, IIRC, in the sample SDK. | |
| |
Subscribers H/PC Vanguard Posts: | 3,686 |
Location: | Japan | Status: | |
| It might be that it does not refresh correctly because of incorrect loop.
Hope it helps. | |
| |
| Thanks for your reply.
I have herewith sending you the code which i used in my application, In that I faced there is a struck of progress bar in few seconds. I want there should be no struck in the movement of progress bar.
Looking forward for your reply ASAP.
Thanks & Reply
Gan
This is my code for your reference.....
////////////////// code ///////////////////////////
In onInitDialog()
{
...........
AfxBeginThread(HandleMovementBar, this,3,0,0,0 );
}
// The thread implemented to take care of movement bar display continuously.
UINT CDisplayProgress::HandleMovementBar(LPVOID param)
{
TRY{
// constants; counters/initialisers used for tempo bar display
int iBase = 0;
int iFlag = 1;
int iCount = 1;
// The current series display identifier.
CDisplayProgress* dpCurrentSeries = (CDisplayProgress*)param;
while (true) {
//Setting the tempo bar current status display
dpCurrentSeries->m_CtlTempoBar.SetPos(iBase + ((iCount*iFlag)*10));
//calculating the tempo bar next status display
if (iCount == 25)
{
iFlag = iFlag * (-1);
if (iFlag>0)
{
iBase = 0;
}else
{
iBase = 250;
}
iCount = 0;
}
++iCount;
if (!dpCurrentSeries->bContinueMovementDisplay) break; //Exit on screen stop/pause
Sleep(100); //Break for 100 milliseconds.
}
}
CATCH_ALL(e) {
}
END_CATCH_ALL
return 0;
}
| |
|
Seconds to generate: 0.125 - Cached queries : 61 - Executed queries : 9
| | |
|