so die
dll is jetzt verändert:
Delphi-Quellcode:
Public Function start()
As String
MsgBox "
dll"
start = "moin"
End Function
*
Public Sub start2()
MsgBox "pdll"
End Sub
*
Function DLLMain(ByVal a
As Long, ByVal b
As Long, ByVal c
As Long)
As Long
*** DLLMain = 1
End Function
*
Sub Main()
*** '
Dummy
End Sub
Und die Export.def:
LIBARY Project1
EXPORTS
*start
*start2
aber läuft immer noch nicht mit folgender Funktion:
Delphi-Quellcode:
function TForm1.GetPluginInfo (Name : PChar; Plugin : String) : PChar;
type
TDLLFunc = function:String;
var
DLLHandle:THandle;
Ret:PChar;
func:TDllFunc;
begin
Ret := '';
DLLHandle:=LoadLibrary(PChar(ExtractFilePath(paramstr(0))+Plugin+'.dll'));
if DLLHandle >= 32 then
begin
@func := GetProcAddress(DLLHandle,Name);
if Assigned (func) then// hier assigned(func)=false
Ret:=pchar(func);
end;
result:=Ret;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
showmessage(GetPluginInfo('start','a'));
end;
TDLLFunc = function:pchar; läuft auch nicht.