Prueba con algo así y te debería funcionar:;
Código Delphi
[-]
var
H: Thandle;
res:integer;
proc: procedure();stdcall;
begin
H := LoadLibrary('Project1.dll');
if (H >= 32) then begin
MessageDlg('Cargada la DLL...', mtInformation, [mbOK], 0);
proc := nil;
@proc := GetProcAddress(H, 'StartHook');
if Assigned(proc) then begin
MessageDlg('Acceso a la función StartHook', mtInformation, [mbOK], 0);
proc();
MessageDlg('Se ha ejecutadoStartHook', mtInformation, [mbOK], 0);
FreeLibrary(H);
end;
end
else
MessageDlg('Error, no se ha encontrado Project1.DLL', mtError, [mbOk], 0)
end.
end.
Para comprobarlo pon un dialog dentro del procedimiento y verás si se ejecuta.
Aquí he supuesto que la cabecera de la función coincide con esta:
Código Delphi
[-]
proc: procedure();stdcall;