wel working on .net compact framework, i found that as of version 2.0 sp1,it does not support asynchronous calling from a delegate. what this means is that u will not be to call deleagate.BeginXXX.
this is currently not documented very much in the .net cf documentation. The thing is that when u r working in the VS2005 you wil be able to declare a delegate ‘mydel’ and assigned a reference of function say ‘foo’ to it, now when write ‘mydel.’ intellisense wil list the asynchnrous function call namely ‘BeginFoo’ and ‘EndFunction’ and allows u to complete ur line . the compiler will provide the async functiona call stub , beginxxx, endxxx for function xxx, and ur application compiles successfully , now when u run the application it will throw not method not supported exception
this behaviour is not documented in the .net cf documentation. i observed this while working on my application , which has component that was ported from its desktop counterpart. the behaviour appeared from nowhere during the middle of development, while searching for the possible causes , i found that it is not supported on cf and that was burried in an msdn forum,
althoug asynch calls arent supported but threadpool is available on the cf which can lead to an easy workaround for the scenario, a wrapper class with that will take a delegate, and put its own method to be executed on threadpool , does all state management thing required.
delegate mydelegate ;
public static object CallAsynch(delegate mydel ,object state)
myClass asyn=new myClass();
public asyncCaller(object state)
that is just a concept, if u want to return the some values from the function u need to add some more code,