This seems to work...
-------------------------------
ExtForm.dll
-------------------------------
library ExtForm;
procedure FormToolBar(tlbMenu: TTlbForm);
begin
tlbForm := tlbMenu;
end;
exports FormToolBar;
--------------------------------
MainMenu.exe
--------------------------------
function FormExternal(sForm: String=''): IFormInterface;
type
TFormToolBar = procedure(tlbMenu: TTlbForm);
var
hExtForm: Cardinal;
function FormExternal(sForm: String=''): IFormInterface;
var tlbExt: TFormToolBar;
begin
Result := nil;
if sForm <> '' then
begin
hExtForm := LoadLibrary('ExtForm.dll');
if hExtForm <> 0 then
begin
@tlbExt:=GetProcAddress(hExtForm, 'FormToolBar');
if @tlbExt <> nil then tlbExt(tlbMenu);
end;
if hExtForm <> 0 then
Result := FormModule(GetProcAddress(hExtForm,
PChar('Get' + sForm)));
end
else
if hExtForm <> 0 then FreeLibrary(hExtForm);
end;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.