Jump to content
Surendra Singh

Package SynEdit library as Dll

Recommended Posts

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. 

  • Like 2

Share this post


Link to post

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

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.

  • Like 1

Share this post


Link to post
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.

  • Like 1

Share this post


Link to post

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?

  • Like 1

Share this post


Link to post
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
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
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.

  • Like 1

Share this post


Link to post

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
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

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
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
Posted (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 by David Heffernan

Share this post


Link to post
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 🙂

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×