1

I wrote a small C# program for scanning documents. It uses WIA.CommonDialog Class to show the process bar. However, the percentage is not updating, and instead, there is a fixed string "Percent complete" as shown in the image attached. Here is the code:

WIA.CommonDialog dialog = new WIA.CommonDialog();
WIA.ImageFile image = (WIA.ImageFile)dialog.ShowTransfer(scannerItem, FormatID.wiaFormatJPEG);

enter image description here

I need to constantly update the percentage number with the bar.

Community
  • 1
  • 1
Majed Badawi
  • 27,616
  • 4
  • 25
  • 48
  • If you try that code here: https://stackoverflow.com/a/5444340/403671 does it works fine? If yes (it does for me the progress works fine), it may mean your application does not pump Windows (COM) messages for some reason: https://stackoverflow.com/questions/5181777/use-of-application-doevents – Simon Mourier Jun 19 '20 at 07:48
  • @SimonMourier my problem is that the percentage is not showing on transfer. I tried the code you mentioned. Is there a certain parameter I should pass to show it? – Majed Badawi Jun 19 '20 at 11:32
  • Have you tried the code in my link? If it works, the problem is in your context (code you don't show, threading, etc.). – Simon Mourier Jun 19 '20 at 13:11

0 Answers0