Page 2 of 2

Re: How to access a scanner via TWAIN.

Posted: Tue Aug 01, 2017 11:00 pm
by jfaguiar
Estoy tratando de utilizar este dll con múltiples paginas y para escribir yo:
oScan:SetMultiTransfer(1) // Opción para escanear varias páginas
Pero está trabando el equipo cuando vacía la bandeja
Me di cuenta de que está bloqueando el equipo cuando se ejecuta: nDib := (oScan: AcquireToFile (cFilescan)).

Mi Tscan.prg está así:

METHOD AcquireToFile (cFileName) INLINE TW_ACQUIRETOFILENAME (:: hWnd, cFileName)

HB_FUNC( TW_ACQUIRETOFILENAME ) // hWnd, cFileName
{
hb_retni( TWAIN_AcquireToFilename( ( HWND ) hb_parnl( 1 ), hb_parc( 2 ) ) );
}

¿Alguien me puede ayudar?

Estoy usando FiveWin for xHarbour 13.07, Windows 7 32 bits.

Gracias amigos.

Re: How to access a scanner via TWAIN.

Posted: Wed Aug 02, 2017 7:48 am
by Enrico Maria Giordano
This sample is working fine here:

Code: Select all | Expand

#include "Fivewin.ch"


FUNCTION MAIN()

    ? TWAIN_SCANNER( "This is a test.bmp" )

    RETURN NIL


FUNCTION TWAIN_SCANNER( cBmp )

    IF TWAIN_ISAVAILABLE() = 0
        ? "TWAIN is not installed in this computer."
        RETURN .F.
    ENDIF

    RETURN TWAIN_ACQUIRETOFILENAME( 0, cBmp ) = 0


DLL32 STATIC FUNCTION TWAIN_ACQUIRETOFILENAME( hWnd AS LONG, cFile AS LPSTR ) AS LONG;
      PASCAL FROM "TWAIN_AcquireToFilename" LIB "eztw32.dll"

DLL32 STATIC FUNCTION TWAIN_ISAVAILABLE() AS LONG;
      PASCAL FROM "TWAIN_IsAvailable" LIB "eztw32.dll"


EMG

Re: How to access a scanner via TWAIN.

Posted: Wed Aug 02, 2017 1:50 pm
by jfaguiar
Good morning, Enrico.
What your scanner? I'm with a Kodak i1120. With Fivewin for xHarbour 13.07 and Bcc 7.3

Re: How to access a scanner via TWAIN.

Posted: Wed Aug 02, 2017 5:21 pm
by Enrico Maria Giordano
jfaguiar wrote:Good morning, Enrico.
What your scanner? I'm with a Kodak i1120. With Fivewin for xHarbour 13.07 and Bcc 7.3


HP Deskjet F380, latest FWH and same BCC.

EMG

Re: How to access a scanner via TWAIN.

Posted: Thu Aug 03, 2017 8:56 am
by gkuhnert
Problem for me is, that I didn't obtain a licence at the time version 2 of this dll was available. Now they are only selling version numbers 3 and 4. This example however works only with the older dll :?

Re: How to access a scanner via TWAIN.

Posted: Thu Aug 03, 2017 9:12 am
by Enrico Maria Giordano
My function works fine with the free version of the EZTW32.DLL.

EMG

Re: How to access a scanner via TWAIN.

Posted: Thu Aug 03, 2017 9:22 am
by gkuhnert
I didn't find any licence information saying that the dll itself is free. Just found, that the class tscan.prg is free. Do you have a link that clearly states the dll as free? That would be really great :D

Re: How to access a scanner via TWAIN.

Posted: Thu Aug 03, 2017 9:27 am
by Enrico Maria Giordano

Re: How to access a scanner via TWAIN.

Posted: Thu Aug 03, 2017 11:48 am
by gkuhnert
Great! Thank you so much 8)

Re: How to access a scanner via TWAIN.

Posted: Fri Aug 04, 2017 4:34 pm
by Silvio.Falconi
I used CLASS TSCAN32 by Rafa Carmona ( TheFull )
it use Easy TWAIN library (TWAIN.LIB) and EZTW32.dll

there is another method ?