twain_library
twain_library copied to clipboard
DTWAIN_EnableDuplex is not working
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) )
}
}
- I do not know Rust, so I cannot comment on the code.
- What is the scanner model?
- Are you scanning with or without the user-interface being shown?
- You should generate a full TWAIN log by calling DTWAIN_SetTwainLog. Otherwise there is no way to diagnose this issue.
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.