🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.databases.visual-dbase
Article #17

Re: vdbase 5.5 and EZTWAIN

#17
From: Bowen Moursund
Date: Mon, 22 Dec 1997 00:00
50 lines
2501 bytes

Ruediger Spindler wrote in message <349D0C91.9C60FFAB@on-line.de>...
>Hello all vdbase programmers,
>I try to access a TWAIN-compatible scanner from vdbase 5.5, using the
>EXTERNal DLL EZTWAIN 1.06 and 1.07, but getting problems by passing
>the filename to one of it's functions. All other functions are working
>well.
>The code I tried:
>
>***************************************************************************
****
>
>EXTERN CINT TWAIN_AcquireToFilename( CHANDLE, CSTRING ) EZTWAIN.DLL
>EXTERN CINT MessageBox( CHANDLE, CSTRING, CSTRING, CWORD) USER.EXE
>
>      tempfile = "SCANTEMP.BMP"
>      MessageBox( 0, "This file will be created", tempfile, 0 )
>      scanres = TWAIN_AcquireToFilename( 0, tempfile )
>      if scanres > 0                              && (will always fail
>with -2 = illegal filename)
>***************************************************************************
****
>
>Visual dBASE uses:
> - pascal calling convention
> - 16bit DLLs only
> - CHANDLE = 16bit WORD
> - CSTRING = zero terminated char far *
>So everything should be OK...
>
>The problem on this:
>The external Windows DLL-Func "MessageBox" works OK, but the EZTWAIN
>DLL-Func "TWAIN_AcquireToFileName" seems to misunderstand the filename
>and uses garbage-strings (or NULL or empty) instead and so fails to
>create the file...

You might try prototyping the function like this:

 EXTERN CINT TWAIN_AcquireToFilename( CHANDLE, CPTR ) EZTWAIN.DLL

Append a null to the string parameter:

      tempfile = "SCANTEMP.BMP"+chr(0)
      MessageBox( 0, "This file will be created", tempfile, 0 )
      scanres = TWAIN_AcquireToFilename( 0, tempfile )
____
Bowen Moursund
bowenNOSPAM@nerds.com
http://www.mindspring.com/~bowenm/datatech.htm
Technical Details
Message-ID: <67mc6a$6dl@camel20.mindspring.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <349D0C91.9C60FFAB@on-line.de>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 105c7d,fa4c561804677629
X-Google-Attributes: gid105c7d,public
X-Google-Thread: 1162a5,fa4c561804677629
X-Google-Attributes: gid1162a5,public
From: "Bowen Moursund" <supportinfo@borland.com>
Subject: Re: vdbase 5.5 and EZTWAIN
Date: 1997/12/22
Message-ID: <67mc6a$6dl@camel20.mindspring.com>
X-Deja-AN: 309398085
Content-Transfer-Encoding: 7bit
References: <349D0C91.9C60FFAB@on-line.de>
X-Server-Date: 22 Dec 1997 18:40:10 GMT
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
Organization: DataTech
Newsgroups: comp.databases.visual-dbase,borland.public.vdbase.programming