Asynchronous CallBack strange behavior 
Author Message
 Asynchronous CallBack strange behavior

Hi all,

I am having the following strange issue:

Class level variable:

private StringBuilder ghost = new StringBuilder();
private System.Windows.Forms.TextBox textBox2;

Then in an asynchronous callback function

public void OnRecievedData( IAsyncResult ar )
{
...
  mOutText = "SomeText";
  lock(this)
  {
    textBox2.AppendText(mOutText);
    ghost.Append(mOutText);                            
  }
...                    

Quote:
}

Since this is a callback function, it is called
asynchronously.

Then I found out that textBox2.text has all the appended
text, which is good and expected; but ghost.toString()
only has one of the "SomeText".

What could be wrong here? How can I get this to work (to
get all the appended text)?

Thanks

BILL



Sat, 28 May 2005 15:21:13 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Strange, very strange OnGetMinMaxInfo() behavior

2. Strange, very strange OnGetMinMaxInfo() behavior

3. Socket - New Thread or Asynchronous Callback

4. asynchronous delegate callback...

5. Strange exception on asynchronous communication

6. Strange constant behavior - why?

7. ArrayList help (strange behavior)

8. Strange behavior in program

9. Strange tabcontrol behavior

10. xmldom.LoadXml - causes strange behavior

11. Strange DataGrid.SetBinding() Behavior

 

 
Powered by phpBB® Forum Software