- Код: Выделить всё
if (ContainerPanel.ControlCount = 0) or not (ContainerPanel.Controls[0] is VFormClass) then
begin
if ContainerPanel.ControlCount > 0 then
ContainerPanel.Controls[0].Free;
if Assigned(VFormClass) then
begin
VForm:= VFormClass.Create(Self);
with VForm do
begin
Hide;
BorderStyle:= bsNone;
Parent:= ContainerPanel;
Align:= alClient;
Show;
end;
end;
Пробую реализовать что-то подобное:
DLL:
- Код: Выделить всё
library textviewer;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, Classes, TextViewerForm, fc_standart, Forms, Controls,
ExtCtrls;
procedure LoadForm (const AOwnerForm, AOwnerPanel: TComponent);
var Form: TTextViewerFrm;
begin
Form:= TTextViewerFrm.Create(AOwnerForm);
with Form do
begin
Hide;
BorderStyle:= bsNone;
Parent:= (AOwnerPanel as TPanel);
Align:= alClient;
DocumentName:= '';
Show;
end;
end;
exports LoadForm;
begin
end.
вызов dll:
- Код: Выделить всё
var PlgHandle: TLibHandle;
LoadForm: procedure (const AOwnerForm, AOwnerPanel: TComponent);
<...>
PlgHandle:= SafeLoadLibrary(GetFCPath + 'PlugIns\Previewer\textviewer.dll');
@LoadForm:= GetProcAddress(PlgHandle, 'LoadForm');
LoadForm(Self, ContainerPanel);
<...>
Получаю ошибку:

Как её исправить? Компилируются одной версией Lazarus'a.