soukoku / ntwain

A TWAIN lib for dotnet.
MIT License
117 stars 47 forks source link

Problem with twain32.dll with UWP app service #31

Closed christopher-carmichael closed 1 year ago

christopher-carmichael commented 1 year ago

I am using nTwain in a win32 app that is run as an app service to a UWP app. The app works flawlessly when running directly. However when the UWP app calls it via FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync the first error is missing twain_32.dll. So I compiled the twaindsm.dll and put it in the directory of the win32 app and it will then run, however it will not see any twain data sources. So I feel like it needs to use twain_32.dll, but I cannot for the life of me figure out why it will not find it. Even with twain_32.dll in the directory with it, it will not use it. App is compiled in x86.

F1schk0pp commented 1 year ago

I'm not sure if I had the same problem, but in my tests in a WinUi3 app I couldn't start the scan session either. Scanners were displayed to me though.

I think it has something to do with UWP/WinUi3 just not being compatible with it.

In the end I switched to WPF.

But if someone manages to get twain running in UWP or WinUi3, I would be happy to see the solution.

christopher-carmichael commented 1 year ago

I'm not sure if I had the same problem, but in my tests in a WinUi3 app I couldn't start the scan session either. Scanners were displayed to me though.

I think it has something to do with UWP/WinUi3 just not being compatible with it.

In the end I switched to WPF.

But if someone manages to get twain running in UWP or WinUi3, I would be happy to see the solution.

Yeah, I never did figure out Ntwain with UWP, even with the IPC. However I did get it working in Winui3 which I have been building a replacement for old system in anyways. I replied on other issue #41