Tema: Error en DLL
Ver Mensaje Individual
  #5  
Antiguo 30-07-2007
MON___ MON___ is offline
Miembro
 
Registrado: abr 2007
Ubicación: Salamanca (España)
Posts: 84
Reputación: 18
MON___ Va por buen camino
Gracias de nuevo, CheckAll. No creo que sea un problema de tipos (string, pchar).
He depurado paso a paso el código y he inspecionado las variables. El error (EAccessViolation) se produce en "FreeLibrary"

procedure TForm1.SpeedButton1Click(Sender: TObject);
type
TLlamarDLL = function(var s : string; x : integer; si : boolean): boolean;
var
buffer : string;
DLL : HWND;
LlamarDLL : TLlamarDLL;
begin
buffer := '';
DLL := LoadLibrary('monlib.dll');
try
@LlamarDLL := GetProcAddress(DLL, 'buscarValor');
if @LlamarDLL <> nil then
if llamarDLL(buffer, 30, false) then
edit1.text := buffer;
finally
FreeLibrary(DLL);
end;

end;
Responder Con Cita