File -> New ->
Dll Library
Delphi-Quellcode:
library myProcedures;
uses
Windows;
procedure myProcedureOne; stdcall;
begin
MessageBox(0, 'myProcedureOne', 'w00t', MB_OK OR MB_ICONINFORMATION);
end;
extern
myProcedureOne;
end.
--------------
in deinem programm das die
dll laden soll
Delphi-Quellcode:
procedure LoadProcedureFromDll;
var
hDll: cardinal;
myProcedure: procedure;
begin
hDll := LoadLibrary('myProcedures.dll');
if hDll <> 0 then begin
@myProcedure := GetProcAddress(hDll, 'myProcedureOne');
if Assigned(@myProcedure) then
myProcedure;
FreeLibrary(hDll);
end;
end;