hi
ich will mein programm mit plugins versehen...
und dazu hab die diese class:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9:
| TPluginFunction = function(Self: Pointer;CE: TPSScript): boolean; stdcall;
type TPlugin = class Proc : TPluginFunction; Handle : THandle; constructor Create(filename: String); end; |
Create sieht so aus:
Delphi-Quelltext
1: 2: 3: 4: 5: 6:
| constructor TPlugin.Create(filename: String); begin inherited Create; Handle := LoadLibrary(pchar(extractFilePath(Application.ExeName)+'plugins\'+Filename)); @Proc := GetProcAddress(handle,pchar('plugin')); end; |
das ganze läuft gut...
ich kann die proc so of wie ich will ausführen
nur wenn ich das programm beende
dann geht die form weg daraufhin
läufts ein bisschen weiter
und dann bekomm ich:
Quelltext
1:
| *Dateiname* Folgende Exceptions sind aufgetreten: "Zugriffsvcerletzung bei: *Glaub das ist nicht relevant* |
führe ich aber die proc nicht aus so bekomm ich auch keinen fehler beim beenden
vllt. zur info: die proc fügt bei PascalScript 3 einige Functionen hinzu (welche auch functionieren!)
danke im voruas
Mfg
Philipp