Form in DLL (again) lazarus / 21-General ---------------------------------------------------------------------- BSaidus · 2024-10-26 14:07 Hello. Is there any way to incorporate a TFORM in DLL and call it from a program, when form shown in calling application, I must paste it into a tabsheet.       DLL(contains TFORM) ==> Application(Load DLL & call the form) ==> PAST DLL form in a TabSheet. PS, The form uses datasets (TSQLQuery) that must be feeded with TDatabase & TTransaction outside of the DLL (i.e by the calling application). Thank you.     +----------------+         +------------------------------------+       +------------------+     |     DLL           |          |   EXE APP                            |        |  TTabshet       |     +----------------+  ==>+------------------------------------+ ==>+------------------+     | TClientForm  |          | DATAMODULE                        |       | TClientForm   |     | TSQLQuery   |          | TDatabase, TSQLTransation  |        |                     |     +----------------+         +------------------------------------+        +-----------------+ ---------------------------------------------------------------------- Mr.Madguy · 2024-10-26 14:47 I'm not sure, if it's possible without shared memory manager like BorlandMM.dll for Delphi. All other things should be relatively easy. You just need to export function, that returns TClientForm. Something like "function GetForm:TClientForm". And then just call "Application.CreateForm(TClientForm, MyClientForm);" in your EXE. ---------------------------------------------------------------------- cdbc · 2024-10-26 15:03 Hi It's possible. There's a wiki article to get you started, here. In the windows section of the rtl, there's a directory containing fpc's memman dll, just compile it and use it... Regards Benny ---------------------------------------------------------------------- Fred vS · 2024-10-26 15:25 Hello. Here a demo using a MSEgui form in the dll. https://forum.lazarus.freepascal.org/index.php/topic,60072.msg448623.h tml#msg448623 ---------------------------------------------------------------------- cdbc · 2024-10-26 15:31 Hi If you can't find the memory-manager, then here it is:Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {    This file is part of the Free Pascal run time library.    Copyright (c) 2006 by the Free Pascal development team.     Shared memory manager   See the file COPYING.FPC, included in this distribution,    for details about the copyright.     This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  ************************************************************ **********}{$mode objfpc}{$H+}library fpcmm;     function  SysGetmem(Size:ptrint):Pointer;      begin        Result:=System.SysGetmem(Size);      end;     function  SysFreemem(p:pointer):ptrint;      begin        Result:=System.SysFreemem(p);      end;     function  SysFreememSize(p:pointer;Size:ptrint):ptrint;      begin        Result:=System.SysFreememSize(p,Size);      end;     function  SysAllocMem(size:ptrint):Pointer;      begin        Result:=System.SysAllocMem(Size);      end;     function  SysReAllocMem(var p:pointer;size:ptrint):Pointer;      begin        Result:=System.SysReallocMem(p,Size);      end;     function  SysMemSize(p:pointer):ptrint;      begin        Result:=System.SysMemSize(p);      end;     function  SysGetHeapStatus:THeapStatus;      begin        Result:=System.SysGetHeapStatus;      end;     function  SysGetFPCHeapStatus:TFPCHeapStatus;      begin        Result:=System.SysGetFPCHeapStatus;      end;     exports      SysGetmem,      SysFreemem,      SysFreememSize,      SysAllocMem,    SysReAllocMem,      SysMemSize,      SysGetHeapStatus,      SysGetFPCHeapStatus; beginend. Regards Benny ---------------------------------------------------------------------- BSaidus · 2024-10-26 16:44 Thank you all. I'll test and feedback you. Thank you  .