Groups | Blog | Home
all groups > dotnet compact framework > august 2005 >

dotnet compact framework : multithreading problem again


Alien
8/31/2005 12:00:00 AM
hi guys
i still have the problem with the mulithreading problme..
now i wrote like
private void Do()

{

ThreadStart starter = new ThreadStart(FillCallGrid);

Thread t = new Thread(starter);

t.Start();

}

private void FillCallGrid()

{

// loaddata

Delegate upFill = new up(FillCallGrid);

this.Invoke(upFill);


}

private void FillCallGrid()

{

// fill the data into datagird

}





Now i can only see the application ui with an empty datagrid. the
application get stuck and the data never come out.

Please help la!~~~~

Sergey Bogdanov
9/1/2005 12:00:00 AM
The method FillCallGrid has incorrect declaration, it must be
EventHandler - the only delegate type supported by .Invoke in CF:

private void FillCallGrid()
{
// loaddata

Invoke(new EventHandler(FillCallGrid));
}

private FillCallGrid(object sender, EventArgs e)
{
}


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


[quoted text, click to view]
AddThis Social Bookmark Button