Click here to Skip to main content
15,893,594 members
Home / Discussions / C#
   

C#

 
GeneralRe: api DLL for audio shutdown/reset pc:doh: Pin
denpsia8-Dec-05 18:42
denpsia8-Dec-05 18:42 
GeneralRe: api DLL for audio shutdown/reset pc:doh: Pin
Dave Kreskowiak9-Dec-05 3:27
mveDave Kreskowiak9-Dec-05 3:27 
AnswerRe: api DLL for audio shutdown/reset pc Pin
Dave Kreskowiak9-Dec-05 3:31
mveDave Kreskowiak9-Dec-05 3:31 
GeneralRe: api DLL for audio shutdown/reset pc Pin
denpsia11-Dec-05 13:09
denpsia11-Dec-05 13:09 
GeneralRe: api DLL for audio shutdown/reset pc Pin
Dave Kreskowiak11-Dec-05 15:16
mveDave Kreskowiak11-Dec-05 15:16 
GeneralRe: api DLL for audio shutdown/reset pc Pin
denpsia11-Dec-05 18:12
denpsia11-Dec-05 18:12 
GeneralRe: api DLL for audio shutdown/reset pc Pin
Dave Kreskowiak12-Dec-05 12:10
mveDave Kreskowiak12-Dec-05 12:10 
QuestionThread Newbie: Cannot access other thread Pin
2hdass8-Dec-05 17:59
2hdass8-Dec-05 17:59 
Currently I am writing a server program, basiclly in a Form when I click a button it starts the server in another thread.

the other thread will recieve message thru the network, and prints the recieved data onto the form. I run this code and I get an exception saying that the listbox is in another thread and cannot be accessed.

I am new to c# threads, I hope some expert can help me

heres how i did it:

<br />
private void button1_Click(object sender, EventArgs e)<br />
{<br />
lstStatus.Items.Clear();<br />
 	Thread serverthread = new Thread(new ThreadStart(serverThreadStart));<br />
        serverthread.Start();<br />
}<br />
<br />
private void serverThreadStart()<br />
{<br />
	myServer = new XYNetServer("", Convert.ToInt32(txtPort.Text), Convert.ToInt32(txtminthread.Text), Convert.ToInt32(txtmaxthread.Text));<br />
	myServer.SetConnectionFilter(new ConnectionFilterDelegate(ConnectionFilter));<br />
	myServer.SetExceptionHandler(new ExceptionHandlerDelegate(ExceptionHandler));<br />
	myServer.SetBinaryInputHandler(new BinaryInputHandlerDelegate(BinaryInputHandler));<br />
	myServer.SetStringInputHandler(new StringInputHandlerDelegate(StringInputHandler));<br />
	if (myServer.StartServer() == false) throw myServer.GetLastException();<br />
       		Thread.Sleep(6000);<br />
		lstStatus.Items.Add("Thread count: " + myServer.GetThreadCount().ToString());<br />
		lstStatus.Items.Add("Client count: " + myServer.GetClientCount().ToString());<br />
		myServer.StopServer();<br />
		lstStatus.Items.Add("Done!");<br />
}<br />

AnswerRe: Thread Newbie: Cannot access other thread Pin
mikanu8-Dec-05 19:20
mikanu8-Dec-05 19:20 
AnswerRe: Thread Newbie: Cannot access other thread Pin
Nick Hounsome8-Dec-05 22:01
Nick Hounsome8-Dec-05 22:01 
QuestionC#,which Release version is better for downloading NAnt build tool? Pin
sridevi20058-Dec-05 17:50
sridevi20058-Dec-05 17:50 
QuestionWebBrowser not receiving Keystrokes Pin
Arun Appukuttan8-Dec-05 17:25
Arun Appukuttan8-Dec-05 17:25 
QuestionFormatting the data Pin
Winds8-Dec-05 15:53
Winds8-Dec-05 15:53 
QuestionPage Orientation Pin
tatchung8-Dec-05 15:26
tatchung8-Dec-05 15:26 
AnswerRe: Page Orientation Pin
Dave Kreskowiak8-Dec-05 15:58
mveDave Kreskowiak8-Dec-05 15:58 
GeneralRe: Page Orientation Pin
tatchung8-Dec-05 16:11
tatchung8-Dec-05 16:11 
GeneralRe: Page Orientation Pin
Dave Kreskowiak9-Dec-05 3:23
mveDave Kreskowiak9-Dec-05 3:23 
QuestionHow to make datagrid in winform like webform? Pin
dexom8-Dec-05 15:05
dexom8-Dec-05 15:05 
AnswerRe: How to make datagrid in winform like webform? Pin
denpsia8-Dec-05 20:50
denpsia8-Dec-05 20:50 
QuestionHelp!! Capture user login date and time Pin
momoo8-Dec-05 14:07
momoo8-Dec-05 14:07 
AnswerRe: Help!! Capture user login date and time Pin
Vikram A Punathambekar8-Dec-05 16:41
Vikram A Punathambekar8-Dec-05 16:41 
GeneralRe: Help!! Capture user login date and time Pin
momoo8-Dec-05 17:01
momoo8-Dec-05 17:01 
GeneralRe: Help!! Capture user login date and time Pin
Vikram A Punathambekar8-Dec-05 20:52
Vikram A Punathambekar8-Dec-05 20:52 
QuestionCrystal Report in visual studio .net Pin
ayuba asia8-Dec-05 12:23
ayuba asia8-Dec-05 12:23 
QuestionSerial Comunication In C# Pin
ayuba asia8-Dec-05 12:06
ayuba asia8-Dec-05 12:06 

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.