Application.DoEvents

  • Thread starter Thread starter Bob lazarchik
  • Start date Start date
B

Bob lazarchik

Hello:

I have created a component in which I need to do a timeout operation. What
is the equivalent to Application.DoEvents() in a Component.

public virtual bool ReceiveResponse( out string aResponseString, int
aTimeoutInterval )
{
bool aTimeout = false
while ( ( ResponseList.Count = 0 ) && ( !aTimeout ) )
{
// with for the list to get a response.

// this won't work for a component
Application.DoEvents();

// do processing for timeout interval
if ( reached atimeout )
{
aTimeout = true;
}
}

if ( !aTimeout )
{
//process the response
}
else
{
// fire timeout error
}

return aResponse;
}

Thanks


Bob
 
Bob lazarchik said:
I have created a component in which I need to do a timeout operation. What
is the equivalent to Application.DoEvents() in a Component.

The most appropriate thing is to do your work in another thread instead
of using DoEvents in the first place.
 
Back
Top