Does Compact Framework v2.0 support Asynchronous delegates??

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a Win CE v5.0 app I'm building, and I'm trying to use Asynchronous
delegates. It does correctly compile, but I get a runtime
"NotSupportedException" when I hit my Asynchronous delegate code.

Here is a sample:

public delegate String MovementTaskSelect(String primaryKey);

MovementTaskSelect query = new MovementTaskSelect(object.methodName);

query.BeginInvoke("12345", new
AsyncCallback(this.ProcessedQueryResultsAsync), query);

public void ProcessedQueryResultsAsync(IAsyncResult result)
{
try
{
// Step 1 - Harvest results.
MovementTaskSelect query =
(MovementTaskSelect)result.AsyncState;
String queryResults = query.EndInvoke(result);
}
catch (Exception e) // Handle any exceptions that got marshalled
back to us when we called the EndInvoke() method above.
{

}
}

Thanks for any suggestions on how to make Asynchronous delegates work on the
CF v2.0
 
I was afraid of that. We use the Threadpool alot, and occationally
OpenNETCF's background worker object (which is extremely similar to an
asynchronous delegate), but was curious if the CF v2.0 had support for this
natively? That way we could the benefits in any type of object, and not just
control objects.

Do you know if the next version of CF has plans to add this support?

Thanks Daniel
 
Yes, the SDF's BackgroundWorker uses the ThreadPool internally... or I
should say it did in my implementation maybe the team has changed it since:
http://www.danielmoth.com/Blog/2004/12/backgroundworker-for-cf-10.html

No, asynchronous delegates are not supported in v3.5 either, but at least
the NotSupportedException has a better exception message: ".NET Compact
Framework does not support invoking delegates asynchronously."

Cheers
Daniel
 
Back
Top