Ver Mensaje Individual
  #3  
Antiguo 30-06-2006
Javi2 Javi2 is offline
Miembro
 
Registrado: jun 2004
Posts: 152
Reputación: 20
Javi2 Va por buen camino
Gracias a todos por vuestro interés. Aquí adjunto el código donde se llama a la DLL. Lo que hago es añadir la definición de la función pero con la coletilla "external" y el nombre de la DLL.


Código Delphi [-]
unit uMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
 
function BUSCAARTICULO_MostrarDLL: shortstring; stdcall; external 'PrPrueba3.dll';
 
var
Form1: TForm1;
 
implementation
{$R *.dfm}
 
procedure TForm1.Button1Click(Sender: TObject);
var
sCad: string;
begin
//llamada a la DLL
sCad := BUSCAARTICULO_MostrarDLL;
if sCad <> '' then ShowMessage( sCad );
end;
end.
Responder Con Cita