Thema: Delphi Twain

Einzelnen Beitrag anzeigen

hathor
(Gast)

n/a Beiträge
 
#7

AW: Delphi Twain

  Alt 2. Mär 2015, 14:24
So schwer ist das nicht...
Die 64Bit-Version ist ROT:

const
{Name of the Twain library for 32 bits enviroment}
{$IFDEF WIN64}
TWAINLIBRARY: String = 'TWAINDSM.DLL';
{$ELSE}
TWAINLIBRARY: String = 'TWAIN_32.DLL';
{$ENDIF}

Es gibt im WINDOWS-Verzeichnis ein Unterverzeichnis twain_32:
Das könnte mit TwainDirectory gemeint sein.
Vielleicht wird üblicherweise da nach einem Treiber gesucht.
Ich habe nocht etwas Anderes gefunden:
http://sourceforge.net/projects/twain-dsm/files/

Zitat:
TWAIN Data Source Manager [DSM],
compliant with version 2.2 of the TWAIN specification.

[Windows]
The TWAIN DSM is a shared library named TWAINDSM.DLL. There is a 32bit and a
64bit version of this file. TWAINDSM.DLL is installed in the Windows System
directory (normally C:\Windows\System32). If installing the 32bit file on a
64bit system, make sure it ends up in the WOW64 System directory (normally
C:\Windows\SysWow64)

The DSM looks for data sources in C:\Windows\twain_32 or C:\Windows\twain_64.
Data sources are also shared objects, but they have a .ds extension.
ex: datasource.ds

The DSM walks the twain_[32|64] directory and LoadLibrary each .ds
file it finds, then uses GetProcAddress to locate the DS_Entry function.

The DSM looks for the environment variable, TWAINDSM_LOG, for the location of
the log file to write to. If the environment variable is not set, then no log
is kept. Here is an example of setting the environment variable from a
command prompt:
...


Delphi-Quellcode:
function TCustomDelphiTwain.LoadLibrary(): Boolean;
var
  TwainDirectory: String;
begin
  {The library must not be already loaded}
  if (not LibraryLoaded) then
  begin
    Result := FALSE; {Initially returns FALSE}
    {Searches for Twain directory}
    TwainDirectory := GetTwainDirectory();
    {Continue only if twain is installed in an known directory}
    if TwainDirectory <> 'then
    begin

      fHandle := Windows.LoadLibrary(PChar(TwainDirectory + TWAINLIBRARY));
      {If the library was sucessfully loaded}
      if (fHandle <> INVALID_HANDLE_VALUE) then
      begin
...

Geändert von hathor ( 2. Mär 2015 um 14:36 Uhr)
  Mit Zitat antworten Zitat