Существует (если нельзя, но очень хочется, то можно). Правда проверял его работоспособность в VCL, в FM проверьте сами.
program Project2;
uses
Vcl.Forms,
Unit1 in 'Unit1.pas' {Form1};
var
MyVariableInt: Integer;
MyVariableBool: Boolean;
MyVariableStr: string;
exports
MyVariableInt,
MyVariableBool,
MyVariableStr;
{$R *.res}
begin
MyVariableInt := 456;
MyVariableBool := True;
MyVariableStr := 'qwerty'#0;
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
i: ^Integer;
begin
i := GetProcAddress(HInstance, 'MyVariableInt');
if Assigned(i) then
ShowMessage(IntToStr(i^));
i := GetProcAddress(HInstance, 'MyVariableBool');
if Assigned(i) then
ShowMessage(BoolToStr(Boolean(i^)));
i := GetProcAddress(HInstance, 'MyVariableStr');
if Assigned(i) then
ShowMessage(PChar(i^));
end;
end.