winapi - C# WUApiLib - Download and Install Asynchronously -


I am programming from Microsoft using the WUApiLib library. I wrote a simple application that searches for all software updates That are not installed and then download and install them. This section is working perfectly (I use the code found here to help.).

However, I want to use Beginner Download, End Download, Startstool, Library's End Functionality, so that it can report progress, back to the interface the functions of that article are synchronous and the functions that I mentioned They are asynchronous.

I am using the first answer on this page as a template:

However, my invitation () function is never being called and why I Can not understand iUpdateDownloader_on progress progression = new iUpdateDownloader_onprogressChanged (this); IDownloadJob downloadJob = downloader.BeginDownload (progress, new iUpdateDownloader_oncompleted (this), new iUpdateDownloader_state (this)); Public category iUpdate downloading_progress changed: IDownloadProgressChangedCallback {Personal frmMain form1; Public iUpdateDownloader_onprogressChanged (frm main mainform) {this.form1 = mainForm; } // Callback interface changing the progress of ID download ... Call for Public Zero (IDownloadJob DownloadJob, IDownloadProgressChangedCallbackArgs e) {decimal bDownloaded = ((e.Progress TotalBytesDownloaded / 1024) / 1024); Decimal bit downloaded = ((E. Progress TotalBeach Download Download / 1024) / 1024); B downloaded = decimal. Round (bead download, 2); BToDownloaded = Decimal.Round (bToDownloaded, 2); Form1.setdownloadProgressText ("Download UPDATE:" + E.Progression.CortUpdate Indicate + "/" + DownloadJob.Apencies.Contract + "-" + b Downloaded + "Mb" + "/" + bTo Downloaded + " Mb "); }}

I can put a breakpoint on the first line in the attachment function and it never reaches it.

Any thoughts?

First of all I notice that it is wrong: form1.setDownloadProgressText is called a different, asynchronous thread. Calls the UI. You have it in one Wrap it up. Invoch (if WinForms) or Dispatcher.Invoke (if WPF) to UI helpol to merge UI bag.

; IDownloadJob downloadJob = downloader.BeginDownload (progress, new iUpdateDownloader_oncompleted (this), new iUpdateDownloader_state (this));

is not working, unless it is wrapped in a constructor or load load holder, which is not painted here.

My guess is that your estate object has joined before one here, and it is trying to appropriate the form with any other practice other than UI, and it is included in other inventions. (Any contained contained in this is included). P>

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -