Autor Beitrag
mettie84
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 21

Win2k, XP SP2, Linux 9.0
D5 standart, D6 Ent, D7 Ent
BeitragVerfasst: Mi 20.10.04 12:13 
Also ich habe meherere versch. Funktionstypen

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
//Typendeklaration
TMakeRights = function(SecurityLevel: integer; var vRGrant: ShortStr): ShortStr;
TRabatt = function(betrag, satz: integer): integer;

...

//Funktionszeiger
MakeRights: TMakeRights;
Rabatt: TRabatt;


Jetzt möchte ich zum Laden nur eine Function schreiben.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
function ImportSQLFromDll(Name: PAnsiChar; var  <span style="color: red">Proc: ????</span>; ProcHandle: THandle): boolean;
var
  dwError: DWord;
begin

  ProcHandle := LoadLibrary(SQLOperationLib);

  if (ProcHandle <> 0then
  begin
    Proc := GetProcAddress(ProcHandle, Name);
    if not Assigned(Proc) then
      MessageDlg('Die DLL-Funktion "' + Name + '" ist nicht in "' + SQLOperationLib + '" vorhande n oder konnte nicht geladen werden.', mtError, [mbOK], 0);
  end
  else
  begin
    dwError := GetLastError;
    MessageDlg('Fehler beim Laden der Funktion "' + Name +'". Fehlercode: ' + IntToStr(dwError), mtError, [mbOK],0);
  end;
end;


Die rotmarkierte Stelle stellt den Funktionszeiger innerhalb der Importfunktion dar. Welchen Datentyp muss ich hier angeben? Gibt es sowas wie einen "generellen Funktionstyp"?



MfG Matthias

_________________
Wenn das 0:2 schon gefallen ist, dann ist ein 1:1 nicht mehr möglich
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mi 20.10.04 19:50 
Ja. var Proc: Pointer :D

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.