How do you do asynchronous processing in C#



Hello,

I'm trying to implement asynchronous call to COM interface below and having trouble understanding what C# code will allow me to update progress bar while call is running.
I have an object called MyDownloader which has a method of BeginDownload below, I need to periodically update main program about progress and when call is completed to return back to processing.
Any sample code?


HRESULT BeginDownload(
IUnknown* onProgressChanged,
IUnknown* onCompleted,
VARIANT state,
IDownloadJob** retval
);
Parameters
onProgressChanged
[in] An IDownloadProgressChangedCallback interface that is called periodically for download progress changes before completion.
onCompleted
[in] An IDownloadCompletedCallback interface (C++/COM) that is called when an asynchronous download operation is complete.
state
[in] The caller-specific state that AsyncState Property of IDownloadJob returns.
retval
[out] An IDownloadJob interface that contains the properties and methods that are available to a download operation that has started.

Relevant Pages

  • Re: How do I pinvoke this function?
    ... interface is always going to be populated with the entries for the methods ... in IUnknown in the first three slots, follwed by the methods for the ... possibly be a COM interface pointer. ... And the best you could do with the progress pointer is pass it ...
    (microsoft.public.dotnet.languages.csharp)
  • Rechenintensiver Workthread mit Progressbar (Umsetzung von C#/VB nach VC++)
    ... System.Threading.WaitCallback, progress) ... Private Sub bearbeitung ... Public Interface IProgressCallback ...
    (microsoft.public.de.vc)
  • Re: [opensuse] Dropped packages
    ... under the xen hypervisor. ... does ethtool -K $INTERFACE tx off ... "Progress is possible only if we train ourselves to think about programs ...
    (SuSE)
  • Progress Error when calling C# Wrapper using COM objects
    ... First off I am using Progress 10.0A, and I am recieving this error ... Quantifi software contains a bunch of functions in a .net DLL file. ... wrote a wrapper in C# to communicate with progress. ... public interface ICDSPricer ...
    (comp.databases.progress)
  • Re: Progress Error when calling C# Wrapper using COM objects
    ... but can you pass double precision decimals to/from Progress?. ... > Quantifi software contains a bunch of functions in a .net DLL file. ... > wrote a wrapper in C# to communicate with progress. ... > public interface ICDSPricer ...
    (comp.databases.progress)