Thema: Delphi Win32 DLL erstellen

Einzelnen Beitrag anzeigen

Mephistopheles
(Gast)

n/a Beiträge
 
#2

Re: Win32 DLL erstellen

  Alt 29. Apr 2005, 16:32
Code:
typedef BOOL (WINAPI *SCGETJOBINFOFUNC) (SCJOBINFO*);
typedef BOOL (WINAPI *SCGETSAVEFILENAMEFUNC) (SCFILEINFO*);
typedef void (WINAPI *SCENDOFJOBFUNC) ();
Dies entspricht:
Delphi-Quellcode:
type
SCGETJOBINFOFUNC = function(var bla: SCJOBINFO): BOOL; stdcall;
SCGETSAVEFILENAMEFUNC = function(var bla:SCFILEINFO):BOOL; stdcall;
SCENDOFJOBFUNC = procedure(); stdcall;
Viel Erfolg!

Es handelt sich also nur um Typendeklarationen für Funktionspointer. Nicht jedoch um statische Importe!!!

Noch'n Nachtrag: stdcall ist hier ganz wichtig. Delphi übergibt, wie bei VC's fastcall die Parameter zuerst in den Registern und dann auf dem Stack. stdcall benutzt ab dem ersten Parameter den Stack. WINAPI impliziert stdcall!
  Mit Zitat antworten Zitat