I need to call a function using asynchronous delegates, when i go through the tutorial of the AsyncCallback I saw the async call back defined as below:
static void CallbackMethod(IAsyncResult result)
{
// get the delegate that was used to call that
// method
CacheFlusher flusher = (CacheFlusher) result.AsyncState;
// get the return value from that method call
int returnValue = flusher.EndInvoke(result);
Console.WriteLine("The result was " + returnValue);
}
Please let me know if i can get the return value as reference from the function. eg:= my function is in the format
void GetName(int id,ref string Name);
Here i am getting the output from the function through a reference variable. If i call this function using the async delegates how can i read the output from the callback function?
You need to wrap your arguments into an object: