FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to access a scanner via TWAIN.
Posts: 2
Joined: Mon Mar 22, 2010 02:43 AM
Re: How to access a scanner via TWAIN.
Posted: Tue Aug 01, 2017 11:00 PM

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.

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to access a scanner via TWAIN.
Posted: Wed Aug 02, 2017 07:48 AM
This sample is working fine here:

Code (fw): Select all Collapse
#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
Posts: 2
Joined: Mon Mar 22, 2010 02:43 AM
Re: How to access a scanner via TWAIN.
Posted: Wed Aug 02, 2017 01:50 PM

Good morning, Enrico.
What your scanner? I'm with a Kodak i1120. With Fivewin for xHarbour 13.07 and Bcc 7.3

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to access a scanner via TWAIN.
Posted: Wed Aug 02, 2017 05:21 PM
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
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: How to access a scanner via TWAIN.
Posted: Thu Aug 03, 2017 08:56 AM

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 :?

Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to access a scanner via TWAIN.
Posted: Thu Aug 03, 2017 09:12 AM

My function works fine with the free version of the EZTW32.DLL.

EMG

Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: How to access a scanner via TWAIN.
Posted: Thu Aug 03, 2017 09:22 AM

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

Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: How to access a scanner via TWAIN.
Posted: Thu Aug 03, 2017 11:48 AM

Great! Thank you so much 8)

Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: How to access a scanner via TWAIN.
Posted: Fri Aug 04, 2017 04:34 PM

I used CLASS TSCAN32 by Rafa Carmona ( TheFull )
it use Easy TWAIN library (TWAIN.LIB) and EZTW32.dll

there is another method ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion