I'll get to the point.
Here's my code for calling conv.Convert asynchronously:
[csharp]
ToHTMLConverter conv = new ToHTMLConverter();
ASyncConvert aconv = new ASyncConvert(conv.Convert);
AsyncCallback aconvcallback = new AsyncCallback(this.HandleConverterCallback);
IAsyncResult result = aconv.BeginInvoke(fullpath, outfilename, out sErrMsg, true, aconvcallback, null);
[/csharp]
Here's my code defining HandleConverterCallback:
[csharp]
private void HandleConverterCallback(IAsyncResult result)
{
try
{
object sErrMsg;
ASyncConvert aconv = (ASyncConvert)result.AsyncState;
bool convertresult = aconv.EndInvoke(out sErrMsg, result);
}
catch (Exception ex)
{
// Problem occured when handling callback.
}
}
[/csharp]
The question is why is the result.AsyncState returns null? This has never happened before. I usually get the aconv object so that I can call the EndInvoke method.
Any clues?
Here's my code for calling conv.Convert asynchronously:
[csharp]
ToHTMLConverter conv = new ToHTMLConverter();
ASyncConvert aconv = new ASyncConvert(conv.Convert);
AsyncCallback aconvcallback = new AsyncCallback(this.HandleConverterCallback);
IAsyncResult result = aconv.BeginInvoke(fullpath, outfilename, out sErrMsg, true, aconvcallback, null);
[/csharp]
Here's my code defining HandleConverterCallback:
[csharp]
private void HandleConverterCallback(IAsyncResult result)
{
try
{
object sErrMsg;
ASyncConvert aconv = (ASyncConvert)result.AsyncState;
bool convertresult = aconv.EndInvoke(out sErrMsg, result);
}
catch (Exception ex)
{
// Problem occured when handling callback.
}
}
[/csharp]
The question is why is the result.AsyncState returns null? This has never happened before. I usually get the aconv object so that I can call the EndInvoke method.
Any clues?