Does Compact Framework v2.0 support Asynchronous delegates??

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
 
G

Guest

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
 
D

Daniel Moth

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top