dynarithmic / twain_library

Dynarithmic TWAIN Library, Version 5.x
Apache License 2.0
55 stars 24 forks source link

DTWAIN_EnableDuplex is not working #84

Open HezinTUKE opened 8 months ago

HezinTUKE commented 8 months ago

Hello, I have a problem with DTWAIN_EnableDuplex. I have set bEnable to false, but the source is always scanned as duplex. My code :

pub fn DTWAIN_EnableDuplex(&self, lib : &Library) -> Result<bool, Box<dyn std::error::Error>> {
        unsafe {
            let duplex: libloading::Symbol<unsafe fn(*mut i32, bool) -> bool> = lib.get(b"DTWAIN_EnableDuplex").unwrap();

            Ok( duplex(self.source, false) )
        }
}
dynarithmic commented 8 months ago
dynarithmic commented 8 months ago

Also, I highly suggest you test your scanner with the DTWDEMO.EXE program, or at least one of the known demo programs. Since I don't know Rust, I have no idea what the code is doing or whether things are set up correctly. What I do know is if the demo programs do not work for your scanner, I have something to work with.

If the demo program works correctly, then investigate if you are using DTWAIN correctly inside of your program.