Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DTWAIN_EnableDuplex is not working #84

Open
HezinTUKE opened this issue Oct 30, 2023 · 2 comments
Open

DTWAIN_EnableDuplex is not working #84

HezinTUKE opened this issue Oct 30, 2023 · 2 comments

Comments

@HezinTUKE
Copy link

HezinTUKE commented Oct 30, 2023

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
Copy link
Owner

dynarithmic commented Oct 30, 2023

  • 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.

@dynarithmic
Copy link
Owner

dynarithmic commented Oct 30, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants