N
Nuno Magalhaes
Why does the MessageBox.Show function in the thread below changes the
program behaviour, in other words, the APListView becomes filled with
values with a call to RefreshAPListView. Without the MessageBox.Show
function, in my laptop, the code doesn't get past the inner loop where
there is a Thread.Sleep(10).
Here is the code. Does anyone know why? Thanks.
private void APRun()
{
while(true)
{
//Get apData info
AP_DATA[] apData=null;
while(true)
{
apData=Wrapi.GetAPList();
if(apData.Length!=0)break;
else Thread.Sleep(10);
}
UpdateTotalAPDataList(apData);
RefreshAPListView();
//Sleep thread
Thread.Sleep(1000);
//This loop can or cannot be here
MessageBox.Show("Loop mark");
}
}
program behaviour, in other words, the APListView becomes filled with
values with a call to RefreshAPListView. Without the MessageBox.Show
function, in my laptop, the code doesn't get past the inner loop where
there is a Thread.Sleep(10).
Here is the code. Does anyone know why? Thanks.
private void APRun()
{
while(true)
{
//Get apData info
AP_DATA[] apData=null;
while(true)
{
apData=Wrapi.GetAPList();
if(apData.Length!=0)break;
else Thread.Sleep(10);
}
UpdateTotalAPDataList(apData);
RefreshAPListView();
//Sleep thread
Thread.Sleep(1000);
//This loop can or cannot be here
MessageBox.Show("Loop mark");
}
}