Ver Mensaje Individual
  #1  
Antiguo 16-04-2006
albertoP albertoP is offline
No confirmado
 
Registrado: ene 2006
Posts: 35
Reputación: 0
albertoP Va por buen camino
Thumbs up No me devuelve valor un funccion creada dentro de una DLL

Hola:

Código Delphi [-]
library MinMax;
function Min(X, Y: Integer): Integer; stdcall;
begin
if X < Y then Min := X else Min := Y;
end;
function Max(X, Y: Integer): Integer; stdcall;
begin
if X > Y then Max := X else Max := Y;
end;
exports
Min,
Max;
begin
end.

Este es el codigo de ejemplo para una DLL, ahora cuando intento recuperarla desde mi APP no me saleAqui les pego el codigo de mi UNIt para que me ayuden a saber como recupero el valor)

Código Delphi [-]
unit Unit1;
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;
var
Form1: TForm1;
procedure MensajeDll(msg:String); external 'dll.dll';
function min(x,y:Integer):Integer; external 'dll.dll';
 
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var a:Integer;
begin
ShowMessage(IntToStr(min(2,3)));
end;

saludos desde ya muchas gracias
Responder Con Cita