How to access a scanner via TWAIN.

Re: How to access a scanner via TWAIN.

Postby jfaguiar » 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.
jfaguiar
 
Posts: 2
Joined: Mon Mar 22, 2010 2:43 am

Re: How to access a scanner via TWAIN.

Postby Enrico Maria Giordano » Wed Aug 02, 2017 7:48 am

This sample is working fine here:

Code: Select all  Expand view  RUN
#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
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: How to access a scanner via TWAIN.

Postby jfaguiar » Wed Aug 02, 2017 1:50 pm

Good morning, Enrico.
What your scanner? I'm with a Kodak i1120. With Fivewin for xHarbour 13.07 and Bcc 7.3
jfaguiar
 
Posts: 2
Joined: Mon Mar 22, 2010 2:43 am

Re: How to access a scanner via TWAIN.

Postby Enrico Maria Giordano » Wed Aug 02, 2017 5: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
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: How to access a scanner via TWAIN.

Postby gkuhnert » Thu Aug 03, 2017 8: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
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Re: How to access a scanner via TWAIN.

Postby Enrico Maria Giordano » Thu Aug 03, 2017 9:12 am

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: How to access a scanner via TWAIN.

Postby gkuhnert » Thu Aug 03, 2017 9: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
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands


Re: How to access a scanner via TWAIN.

Postby gkuhnert » Thu Aug 03, 2017 11:48 am

Great! Thank you so much 8)
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Re: How to access a scanner via TWAIN.

Postby Silvio.Falconi » Fri Aug 04, 2017 4: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7088
Joined: Thu Oct 18, 2012 7:17 pm

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 40 guests