Thema: Delphi Win32 DLL erstellen

Einzelnen Beitrag anzeigen

NicoDE
(Gast)

n/a Beiträge
 
#3

Re: Win32 DLL erstellen

  Alt 29. Apr 2005, 16:59
Versuch's mit der Übersetzung (bei Unicode musst Du noch 'UNICODE' definieren)
Delphi-Quellcode:
type
  TScColorType = type Longint;
const
  SC_OUTPUT_BLACKWHITE = TScColorType(1);
  SC_OUTPUT_GRAYSCALE = TScColorType(2);
  SC_OUTPUT_COLOR = TScColorType(3);

type
  TScTiffCompression = type Longint;
const
  SC_TIFTYPE_NONE = TScTiffCompression(1);
  SC_TIFTYPE_PACKBITS = TScTiffCompression(2);
  SC_TIFTYPE_CCITT_HUFFMAN = TScTiffCompression(3);
  SC_TIFTYPE_CCITT_T4 = TScTiffCompression(4);
  SC_TIFTYPE_CCITT_T6 = TScTiffCompression(5);
  SC_TIFTYPE_JPEG = TScTiffCompression(6);

type
  PScJobInfoA = ^TScJobInfoA;
  TScJobInfoA = packed record
    formName : array [0..31] of AnsiChar;
    printQuality : Longint;
    colorType : TScColorType;
    jpegQuality : Longint;
    tiffCompression: TScTiffCompression;
    tiffQuality : Longint;
    pdfQuality : Longint;
  end;
  PScJobInfoW = ^TScJobInfoW;
  TScJobInfoW = packed record
    formName : array [0..31] of WideChar;
    printQuality : Longint;
    colorType : TScColorType;
    jpegQuality : Longint;
    tiffCompression: TScTiffCompression;
    tiffQuality : Longint;
    pdfQuality : Longint;
  end;
  PScJobInfo = ^TScJobInfo;
{$IFDEF UNICODE}
  TScJobInfo = TScJobInfoW;
{$ELSE}
  TScJobInfo = TScJobInfoA;
{$ENDIF}

type
  TScFileType = type Longint;
const
  SC_BMP = TScFileType(1);
  SC_PNG = TScFileType(2);
  SC_JPG = TScFileType(3);
  SC_TIF_SINGLE = TScFileType(4);
  SC_PDF_SINGLE = TScFileType(5);
  SC_TIF_MULTIPLE = TScFileType(6);
  SC_PDF_MULTIPLE = TScFileType(7);

type
  TScFileInfo = packed record
    name : array [0..MAX_PATH-1] of WideChar;
    ext : array [0..MAX_PATH-1] of WideChar;
    type_: TScFileType;
  end;

type
  TFNScGetJobInfoFunc = function(var TScJobInfo): BOOL; stdcall; // scGetJobInfo
  TFNScGetSaveFileNameFunc = function(var TScFileInfo): BOOL; stdcall; // scGetSaveFileName
  TFNScEndOfJobFunc = procedure; stdcall; // scEndOfJobFunc
Zitat von bdaehn:
Code kompiliert, aber ich bekomme bei der Benutzung des Treibers eine "Memory could not be read" Execptions - irgendeine Idee ?
Könnte auch mit Initialisierung der Delphi-Runtime in der DLL zu tun habe... aber um das auszuschliessen müsste man eine eigene RTL schreiben...).
Nimm alles aus der Uses-Liste raus was Du nichts brauchst (ShareMem hat in Deiner DLL nichts zu suchen!).
  Mit Zitat antworten Zitat