Jump to content
shineworld

Add extra components without touch DelphiVCL

Recommended Posts

So far, when I wanted to add a new UI component to DelphiVCL, I always started from DelphiVCL source, added the new unit with classes and types, and created a “clone” of the package with the new functionality using that instead of DelphiVCL.

It works but I would like to “not touch” the original version of DelphiVCL installed by PyPi but only create an extensive module (pyd) with only the new UI controls.

At this point I don't know if this can be done.
I still understand little about P4D but it seems to me that each new module requires a PyEngine which loads the python DLL and this is already instantiated by DelphiVCL and if I create a new package with my new module and controls I assume there will be conflicts.

Is this a viable way ?
Is there any way to reuse the egine already created by original DelphiVCL to use it in my custom PYD ?

 

I thank in advance those who will help me to dispel these doubts.

Best regards
Silverio

 

Share this post


Link to post
8 hours ago, shineworld said:

it seems to me that each new module requires a PyEngine which loads the python DLL and this is already instantiated by DelphiVCL

This is not correct.  When P4D is used in an extension module it uses LoadDllInExtensionModule which just uses the dll loaded in the python process.  It does not load or initialize the python dll.  The calling process does that.  So you can have more than one Delphi generated pyd files without issues.

Edited by pyscripter
  • Thanks 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

×