Modular lazarus / 13-General ---------------------------------------------------------------------- tasca · 2009-05-15 12:14 Hi all, how modular application? Main.exe ->          Modulo1.dll (or .anyway) load the HD          Modulo2.dll          Module?.dll Cross-plataform (Linux e Win) grazie mille... ---------------------------------------------------------------------- tasca · 2009-05-19 12:11 Form or Frames in lib? Forms can also be in a library. the main call form the inside of a library. ---------------------------------------------------------------------- Ñuño_Martínez · 2009-05-19 16:02 I'm sorry but I don't understand. Are you asking, arguing or affirming? ---------------------------------------------------------------------- tasca · 2009-05-19 17:02 Asking sorry my english ---------------------------------------------------------------------- Lord_ZealoN · 2009-05-19 18:20 I think he is asking for the way (or the normal way to follow) how he can make portable libraries in his application. ---------------------------------------------------------------------- tasca · 2009-05-20 11:31 Main called       -> stock       ->financial       -> other... functions in modules outside of the executable. loads the module if you use on appdir windows X:\dir  main.exe stock.dll financial.dll other.dll linux $ls main stock.o financial.o other.o in separate modules, not need .dll or .o, to reduce size of executable. ---------------------------------------------------------------------- Ñuño_Martínez · 2009-05-21 10:17 Dynamic libraries are for reuse functionality not to reduce executable size. Actually an application that uses dynamic libraries needs more RAM than the ones that uses static libraries in most cases because they need extra code and data to load the libraries and link procedures, functions and variables. By the way, UNIX-like systems dynamic libraries are called "shared objects" and have extension ".so" in most cases. MacOS systems call them "dynamic libraries" too but IIRC their extension is ".dynlib". ---------------------------------------------------------------------- tasca · 2009-05-22 15:44 I did not understand me. One module "Orange" call other module "Orange1", "Orange2", "Orange X" application modules, not library. sorry ---------------------------------------------------------------------- Ñuño_Martínez · 2009-05-25 12:28 Do you mean that? Code: [Select]PROGRAM MyProgram; USES   MyUnit; BEGIN   MyProcedure; END. Code: [Select]UNIT MyUnit; INTERFACE     PROCEDURE MyProcedure; IMPLEMENTATION     PROCEDURE MyProcedure;   BEGIN     WriteLN ('In my procedure');   END; END. Results in: #> MyProgram In my procedure #> ---------------------------------------------------------------------- Lord_ZealoN · 2009-05-25 12:43 We are spending more time to understand the post, thath to answer it ROFL ---------------------------------------------------------------------- LazaruX · 2009-05-25 13:23 I think the question is: how to create external DLL's for both Windows and Linux. Since DLL is Windows stuff, not Linux. ---------------------------------------------------------------------- Lord_ZealoN · 2009-05-25 13:39 Quote from: Lord_ZealoN on May 19, 2009, 08:20:17 pmI think he is asking for the way (or the normal way to follow) how he can make portable libraries in his application. I think the same, What I said ---------------------------------------------------------------------- tasca · 2009-05-26 10:49 Forget if you do not understand the question because respond? Ñuño_Martínez,  myprogram in one file  myunit in other file. ---------------------------------------------------------------------- LazaruX · 2009-05-26 16:59 ITALIAN: Se sei italiano, scrivi in italiano che traduco. Sara` meglio per tutti ENGLISH: If you are italian, write in italian, I will translate it. It will be better for all of us. ---------------------------------------------------------------------- icebit · 2009-05-26 19:00 Hi everyone. My first post on this forum. Check the attached source code. Compile main.lpi and lib.lpi. Is this what you want ? PS: This is win32 specific. ---------------------------------------------------------------------- tasca · 2009-05-26 20:56 Quote from: BPsoftware on May 26, 2009, 06:59:06 pmITALIAN: Se sei italiano, scrivi in italiano che traduco. Sara` meglio per tutti ENGLISH: If you are italian, write in italian, I will translate it. It will be better for all of us. ciao No, io sono Brasiliano, ma ha vissuto in Itália, per rendere la cittadinanza. deve dividere il file eseguibile in diversi moduli non tutto in un unico eseguibile. il modulo principale invita gli altri moduli in HD. grazie ---------------------------------------------------------------------- Troodon · 2009-05-26 22:15 Okay, so you want to "divide" the executable into several "modules" and the main executable must call each of these "modules". What exactly do you mean by "module"? The dll/so/dynlib seem to be the closest concept to what you need. Alternatively, you may wish to run a main program that can launch other standalone executable "modules" as separate processes. ---------------------------------------------------------------------- icebit · 2009-05-26 23:46 Quote from: tasca on May 26, 2009, 10:56:28 pm ciao No, io sono Brasiliano, ma ha vissuto in Itália, per rendere la cittadinanza. deve dividere il file eseguibile in diversi moduli non tutto in un unico eseguibile. il modulo principale invita gli altri moduli in HD. grazie Eu também sou brasileiro. Vc. viu o post anterior com um código exemplo. Dê uma olhada, qualquer dúvida estou a disposição. []´s ---------------------------------------------------------------------- Lord_ZealoN · 2009-05-27 07:40 Quote from: tasca on May 26, 2009, 12:49:26 pm Forget if you do not understand the question because respond? Ñuño_Martínez,  myprogram in one file  myunit in other file. I only tried to help. No problem, I will take in count for future post Cheers. ---------------------------------------------------------------------- icebit · 2009-05-27 14:56 Hello again. I received a PM from Tasca, and finally understood what he wants. I think he has an ERP style system with many sub-parts. He wants do manage this sub-parts from a centralized program that he calls "main". The sub-parts he calls "modules". This way he can only deploy the sub- parts needed by his customers. So the role idea is to deploy the main program as .exe and the modules as .dll (.so). This way his customers can only run the parts through main.exe. They cannot execute sub-parts directly. I did something like this back 1999. So i sent him an sample code. If anyone is interested, i posted it here too.(#1) In Delphi, its possible to deploy the BPL. This is another way to split the software. I think that he could use IPC too, in case he wants to do some validation in sub-programs. This way sub-programs can be .exe. ---------------------------------------------------------------------- Ñuño_Martínez · 2009-06-02 12:54 Quote from: icebit on May 27, 2009, 04:56:54 pmHello again. I received a PM from Tasca, and finally understood what he wants. I think he has an ERP style system with many sub-parts. He wants do manage this sub-parts from a centralized program that he calls "main". The sub-parts he calls "modules". This way he can only deploy the sub- parts needed by his customers. So the role idea is to deploy the main program as .exe and the modules as .dll (.so). This way his customers can only run the parts through main.exe. They cannot execute sub-parts directly. I did something like this back 1999. So i sent him an sample code. If anyone is interested, i posted it here too.(#1) In Delphi, its possible to deploy the BPL. This is another way to split the software. I think that he could use IPC too, in case he wants to do some validation in sub-programs. This way sub-programs can be .exe.   Oh, man! ---------------------------------------------------------------------- martinrame · 2009-06-02 20:31 Read this and try to use in Lazarus http://leonardorame.blogspot.com/2008/10/delphi-plugin-by-example.html ---------------------------------------------------------------------- sauer2 · 2009-06-04 19:39 Hi, i have some questions about modules and forms. The classic situation is like this Quotemain.pas file, can call functions and procedures from other units by including them into "uses".right? In Lazarus, i noticed that every form has an unit/.pas file.  But some situation needs several forms to interact with each other, but i also noticed that it is impossible to make "use" each other. Someone told me about interfaces, could someone explain this a bit more detailed, with an example? thanks and best regards Sauer2 ---------------------------------------------------------------------- clauslack · 2009-06-04 20:04 Well, for example for avoid circular reference. In Unit1.pas, in interface put uses unit2 Code: [Select]unit Unit1; {$mode objfpc}{$H+} interface uses   Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,   StdCtrls,unit2; .... In Unit2.pas, in implementation put uses unit1; Code: [Select]unit Unit2; {$mode objfpc}{$H+} interface uses   Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,   StdCtrls; type   { TForm2 }   TForm2 = class(TForm)     Button1: TButton;     Edit1: TEdit;     procedure Button1Click(Sender: TObject);   private     { private declarations }   public     { public declarations }   end; var   Form2: TForm2; implementation  uses unit1; { TForm2 } .... Regards ---------------------------------------------------------------------- sauer2 · 2009-06-05 07:26 Thank you! ---------------------------------------------------------------------- tasca · 2009-06-08 13:43 GetProcAddress( FLibHandle, 'MyFormClass'); unit1.pas(43,36) Error: Identifier not found "GetProcAddress" GetProcAddress it's implemented? ---------------------------------------------------------------------- clauslack · 2009-06-08 13:51 GetProcAddress is in windows unit; uses windows; ---------------------------------------------------------------------- icebit · 2009-06-08 13:59 Quote from: tasca on June 08, 2009, 03:43:38 pm GetProcAddress( FLibHandle, 'MyFormClass'); unit1.pas(43,36) Error: Identifier not found "GetProcAddress" GetProcAddress it's implemented? Add dynlibs to your uses clause. ---------------------------------------------------------------------- cpalx · 2009-06-11 17:19 Si hablas español, escribe y lo traducire por ti. If you speak spanish, then write it and i will translate for you