Surendra Singh 0 Posted July 18, 2022 How to package the SynEdit library as DLL and dynamically link into other project. Share this post Link to post
David Heffernan 2353 Posted July 18, 2022 Don't. Best option is to compile it directly into each project. Next best is to compile into a Delphi package. Direct inclusion is much more simple. 2 Share this post Link to post
Surendra Singh 0 Posted July 18, 2022 Thanks David for the reply. I know direct inclusion in the project is simple but it doesn't solve my purpose. I don't want to include the source in my project, is there any other way to achieve this? Share this post Link to post
Anders Melander 1815 Posted July 18, 2022 You can create a run-time package containing synedit (a run-time package is a DLL) and link against that but one way or the other you are going to create a dependency on synedit and compiling it directly into your project is the the option that will give you the least problems. 1 Share this post Link to post
dummzeuch 1517 Posted July 18, 2022 1 hour ago, Surendra Singh said: I don't want to include the source in my project, is there any other way to achieve this? What exactly do you mean by "include the sources"? If it is about not compiling the sources all the time, you could simply link precompiled dcu files. If it's about not having the compiled code in your executable, the best way is linking with packages, which has some drawbacks though. A DLL is the worst option as you would lose the ability to easily add those controls to your forms. 1 Share this post Link to post
David Heffernan 2353 Posted July 18, 2022 Plain native DLLs aren't really practical for components. This is the reason that packages exist. So if you need the code in a separate module, use a package. But packages introduce complexity for deployment and versioning. Why don't you want direct inclusion of the code in your executable? 1 Share this post Link to post
Surendra Singh 0 Posted July 19, 2022 21 hours ago, dummzeuch said: What exactly do you mean by "include the sources"? If it is about not compiling the sources all the time, you could simply link precompiled dcu files. If it's about not having the compiled code in your executable, the best way is linking with packages, which has some drawbacks though. A DLL is the worst option as you would lose the ability to easily add those controls to your forms. Include the source means including source of SynEdit library in the project. We do not want to include the third party components like SynEdit directly to our code, only linking it dynamically. Could you please let us know the disadvantages and problems we might be facing in doing it dynamically? Share this post Link to post
Surendra Singh 0 Posted July 19, 2022 21 hours ago, David Heffernan said: Plain native DLLs aren't really practical for components. This is the reason that packages exist. So if you need the code in a separate module, use a package. But packages introduce complexity for deployment and versioning. Why don't you want direct inclusion of the code in your executable? We cannot include the third party components like SynEdit library directly to our code, only option we see is linking it dynamically. Could you please let us know the disadvantages and problems we might be facing in doing it dynamically? Share this post Link to post
David Heffernan 2353 Posted July 19, 2022 1 hour ago, Surendra Singh said: Could you please let us know the disadvantages and problems we might be facing in doing it dynamically? If you try to use a DLL rather than a package, then it won't work. The simple way to think about it is that your GUI code and the components all need to share the same instance of the RTL and VCL. Packages enable that sharing. Plain DLLs do not. 1 hour ago, Surendra Singh said: We cannot include the third party components like SynEdit library directly to our code, only option we see is linking it dynamically. Yes you can. Many of us do that all the time. Is it really too much to ask why you think you cannot compile third party code into your main executable? If perhaps you think that licensing is the issue then I doubt that putting the code into a separate dynamically linked module changes anything. 1 Share this post Link to post
Fr0sT.Brutal 900 Posted July 25, 2022 It's possible to use a VCL component from DLL, with some drawbacks & limitations. Search for "Plugins in Delphi" and "Delphi Form from DLL" Share this post Link to post
Surendra Singh 0 Posted July 27, 2022 On 7/25/2022 at 2:02 PM, Fr0sT.Brutal said: It's possible to use a VCL component from DLL, with some drawbacks & limitations. Search for "Plugins in Delphi" and "Delphi Form from DLL" @Fr0sT.BrutalThanks for your suggestion. If we make the project from scratch it is doable as seen. But how to convert our existing project to DLLs Share this post Link to post
Fr0sT.Brutal 900 Posted July 27, 2022 Nothing prevents you from taking abovementioned approaches in existing project. Just borrow all the tricks required to utilize a component contained in DLL. Share this post Link to post
David Heffernan 2353 Posted July 27, 2022 Do remember to make sure that you meet the requirements of the open source MPL license Share this post Link to post
Fr0sT.Brutal 900 Posted July 27, 2022 1 hour ago, David Heffernan said: Do remember to make sure that you meet the requirements of the open source MPL license Wiki says it's 3-licensed and one of these licenses is Apache which allows any license of the derived product Share this post Link to post
David Heffernan 2353 Posted July 27, 2022 (edited) 3 hours ago, Fr0sT.Brutal said: Wiki says it's 3-licensed and one of these licenses is Apache which allows any license of the derived product MPL allows any license of the derived product I think. And the source code in the synedit 2 repo says the license is MPL. But asker believes that putting the code in a dll means that they don't need to worry about the license. Which is nonsense obviously. And in any case, even if it did make a difference, use a package already!! Edited July 27, 2022 by David Heffernan Share this post Link to post
Fr0sT.Brutal 900 Posted July 28, 2022 11 hours ago, David Heffernan said: But asker believes that putting the code in a dll means that they don't need to worry about the license We still don't realize what exactly the asker intends to achieve 🙂 1 Share this post Link to post