Thema: Delphi Win32 DLL erstellen

Einzelnen Beitrag anzeigen

bdaehn

Registriert seit: 22. Jan 2004
Ort: Wiesbaden
9 Beiträge
 
Delphi 7 Enterprise
 
#8

Re: Win32 DLL erstellen

  Alt 1. Mai 2005, 18:33
Hallo!

So sieht der Code nun im Moment aus - hab's sowohl mit Pointern als auch mit Referenzen (var) probiert - immer dergleiche Effekt ( getjobinfo() wird ab und zu mal aufgerufen, getsavefilename() nie und endofjob() immer) - in meinem Demo greife ich auch ueberhaupt noch gar nicht auf die Uebergabewerte zu - gebe ja nur eine Message aus - deshalb denke ich nicht, dass es mit den Uebergabeparametern was zu tun hat.
Noch irgendeine Idee, was faul sein koennte?

Habe mit einer in Visual C++ geschriebenen DLL ueberprueft, dass wirklich alle 3 Funkionen aufgerufen werden...

Delphi-Quellcode:
library softcopyex;


uses
    Windows,Dialogs;

{$R *.res}

{$DEFINE UNICODE}

type
  TScColorType = type Longint;
const
  SC_OUTPUT_BLACKWHITE = TScColorType(1);
  SC_OUTPUT_GRAYSCALE = TScColorType(2);
  SC_OUTPUT_COLOR = TScColorType(3);

type
  TScTiffCompression = 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;

{$IFDEF UNICODE}
  TScJobInfo = TScJobInfoW;
{$ELSE}
  TScJobInfo = TScJobInfoA;
{$ENDIF}
  PScJobInfo = ^TScJobInfo;

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
  PScFileInfo = ^TScFileInfo;
  TScFileInfo = packed record
    name : array [0..MAX_PATH-1] of WideChar;
    ext : array [0..MAX_PATH-1] of WideChar;
    type_: TScFileType;
  end;

function scGetJobInfo(var test: TScJobInfo):LongBool; stdcall;
var temp : String;

begin
  ShowMessage('GetJobInfo()');
  Result:=True;
end;

function scGetSaveFilename(var test: TScFileInfo):LongBool; stdcall;
var temp : String;

begin
  ShowMessage('scGetSaveFilename()');
  Result:=True;
end;

procedure scEndOfJob(); stdcall;
begin
  ShowMessage('scEndOfJob()');
end;

exports scGetJobInfo, scGetSaveFilename, scEndOfJob;

begin
end.
Vielen Dank und Gruss
/bjoern
  Mit Zitat antworten Zitat