xsharp.eu • Scanner WIA
Page 1 of 1

Scanner WIA

Posted: Thu Jul 29, 2021 6:39 am
by softdevo@tiscali.it
Hello everyone,
I would like to translate a wia scanner application from C # to X #, but with ilspy it can't.
Any advice?
Attach application.
Thanks to all
Danilo

Scanner WIA

Posted: Thu Jul 29, 2021 9:10 am
by TerryB1
Hi Danilo

My advice would be "Try to use the scanner in your program in a different way".

I haven't used it myself, but it is, I think, part of Windows NOT .Net nor therefore iLSpy.

Terry

Scanner WIA

Posted: Thu Jul 29, 2021 9:38 am
by Chris
Hi Danilo,

Here's the X# version as a XIDE app. Just add the app with Project/Add Existing/Add Application, pick the .viapp file and it should directly compile and run. Thanks for posting this nice sample!
WIAScanner.zip
(19.77 KiB) Downloaded 123 times

Scanner WIA

Posted: Thu Jul 29, 2021 10:09 am
by ic2
Hello Terry,
Terry wrote:Hi Danilo
I haven't used it myself, but it is, I think, part of Windows NOT .Net nor therefore iLSpy.
Danilo included the C# project (VS solution). You can see it is a .Net application for sure.
I opened the Scannerapplication.exe from the .exe directory in ILSpy and this showed me X# code without problems. I guess Chris has seen this working too, given his translated X# project in just under 2 hours after posting it.

Dick

Scanner WIA

Posted: Thu Jul 29, 2021 10:21 am
by TerryB1
Hi Dick

Thanks Dick

You're right. I should not have jumped in from distant memories.

Terry

Scanner WIA

Posted: Thu Jul 29, 2021 10:33 am
by softdevo@tiscali.it
Thanks perfect, as always you are very generous

Danilo

Scanner WIA

Posted: Thu Jul 29, 2021 10:34 am
by softdevo@tiscali.it
So maybe I didn't understand how ILspy works
Danilo

Scanner WIA

Posted: Fri Jul 30, 2021 10:25 am
by ic2
Hello Danilo,
softdevo@tiscali.it wrote:So maybe I didn't understand how ILspy works
You just open the exe of the project you want to convert which (in a VS solution) can be found in binrelease or bindebug. Then you select the language from the top and you can see the different classes and methods in that language. Be sure you have downloaded the DLL from https://www.xsharp.eu/itm-downloads?fol ... %252FTools and placed that DLL in the ILSpy directory where the exe resides). Otherwise there is no X# option.

You do not get a full blown project, but you will see the code class by class. Also don't expect 100% perfect translation. Sometimes you get code which probably works but which could be done more straightforward differently.

Hope this helps.

Dick

Scanner WIA

Posted: Fri Jul 30, 2021 10:27 am
by ic2
Hello Terry,
Terry wrote:Hi Dick
You're right. I should not have jumped in from distant memories.
:P

However, you could have been right, some tools do not seem to work and then the reason is that the tool expects Win32 exe's when it's a .Net program or the other way around. I had the same issue a while ago.

Dick

Scanner WIA

Posted: Fri Jul 30, 2021 12:00 pm
by softdevo@tiscali.it
Thank you Dick, Valuable tip
Danilo