unit MainUnit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
 TCompProc= procedure(Str:PChar);StdCall;
 procedure CompS(Str:PChar; Proc:TCompProc);export;StdCall;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

procedure CompS;external 'FuncProject.dll' index 10;


implementation

{$R *.dfm}

procedure CallFromDLL(Str:PChar);StdCall;
begin
 ShowMessage('DLL вызвала эту процедуру. Параметр равен: '+Str);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
 CompS('Привет', @CallFromDLL);
end;

end.
