Jump to content

Search the Community

Showing results for tags 'bpl'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 2 results

  1. My app consists of a main VCL-based app and a number of plugins implemented as .bpl packages. I'd like to incorporate Python using P4D, but I'm having problems. My first attempts work fine in the main app, but I cannot get the bpl's to work. In effect, my main app loads the Python .dll, runs some Python code, then loads the .bpl packages; these packages, however, can't seem to access the Python .dll, as GetPythonEngine thinks the global variable gPythonEngine is nil. My guess is that this is explained because gPythonEngine belongs to the app, and is not visible in the .bpl. I tried loading the Python .dll in both the app and the .bpl, but that doesn't seem to work in a different way when I try to load a Python module. I first try to add a folder to the Python path using the following, abd I get a EPyAttributeError with the message "module 'sys' has no attribute 'Path'. if not Boolean(SysModule.Path.Contains(folder)) then begin SysModule.Path.Insert(0, folder); end; My guess is that I am not going to be able to use P4D from both the main app and several .bpl (i.e. DLLs) simultaneously. It seems there are a few reasons why, but I'm not certain if I understand exactly the limitations. 1. It appears that the Python DLL really only supports one instantiation per process. It isn't entirely clear if this is a DLL restriction or due to the Python DLL's design itself. Is this true absolutely? 2. Even if I could "share" the Python environment created when loading the DLL, I'm likely to run into problems because some functions use that global; for example, the SysModule functions don't provide a means to provide the pointer to the Python environment, but rather access that global directly. Is this correct? 3. Because I use certain .bpls as plug-ins, I can't readily get rid of the .bpls and go to a monolithic architecture, so it seems my only option might be to write another .bpl that encapsulates all the P4D/Python.dll stuff in it, and provides routines for other .bpls and the main app to give access to the Python environment that way. Other than being a bit more work, this does have some nice characteristics, such as hiding all the P4D details in one place, and it formalizes the notion of the Python environment (e.g. when it starts, who "owns" it, and its global nature). This could really work well for my application, as its use of Python is, by domain design, serialized naturally, and benefits from the persistent state from call to call. But before I go down that road, does this even make sense?
  2. My buttons on menu dont appears or Component pallete is blank: NOTE: here, <<20.0>> is my RAD Studio 10.3.3 Arch RIO! -- Tested in RAD 10.4.1 in my VM, too! Possible causes: the BPLs responsible for this part of the IDE have not been loaded, or are in the key: Computer \ HKEY_CURRENT_USER \ SOFTWARE \ Embarcadero \ BDS \ 20.0 \ Disabled Packages for example, there was an error in the BPL file (corrupted for some reason) and you said not to load that BPL anymore ... or the system did it! Unlikely, however ... who knows? Embarcadero only! The line referring to BPL loading, is not defined or is wrong in the Registry. Computer \ HKEY_CURRENT_USER \ SOFTWARE \ Embarcadero \ BDS \ 20.0 \ Known IDE Packages <--- all standard BPLs installed by the installer RAD. Computer \ HKEY_CURRENT_USER \ SOFTWARE \ Embarcadero \ BDS \ 20.0 \ Known Packages <--- all BPLs installed by the user (Embarcadero already installs some for you, by default) Anyway, even when the entire key (Computer \ HKEY_CURRENT_USER \ SOFTWARE \ Embarcadero \ BDS \ 20.0 \) is deleted in the Registry, be aware that RAD Studio can still be loaded with practically all the standard installation components! How does it happen? When you install RAD Studio on your MSWindows, the installer creates a master key with all the default settings needed to start the software. So, when you first start RAD Studio, at this moment, a copy of the master key is made for the user key. Thus, with the exception of subsequent installations and changes, everything can be corrected again. That is, you can start the IDE again with the default installation configuration. Now, all your settings will be lost, of course! The RAD Studio master key is at: Computer \ HKEY_LOCAL_MACHINE \ SOFTWARE \ WOW6432Node \ Embarcadero And, the settings for the user are at: Computer \ HKEY_CURRENT_USER \ SOFTWARE \ Embarcadero In this way, you can delete the user's entire key. When you start the IDE again, you will have the same questions as the first time you use it, and at the end, the user's key will be created again, that is: Computer \ HKEY_CURRENT_USER \ SOFTWARE \ Embarcadero Computer\HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\20.0\Package Cache --> used to do cache of informations of BPLs used in your IDE Don't you like GetIT? So, don't load it! - On Registry key Computer \ HKEY_CURRENT_USER \ SOFTWARE \ Embarcadero \ BDS \ 20.0 \ Known Packages \ rename "$ (BDSBIN) \ gitide260.bpl" to "$ (BDSBIN) \ ___ gitide260.bpl", or any other string. So, when you load the IDE again, it will ask if you want to load this BPL next time. Then, you answer no, and the string "$ (BDSBIN) \ ___ gitide260.bpl" will be moved to: Computer \ HKEY_CURRENT_USER \ SOFTWARE \ Embarcadero \ BDS \ 20.0 \ Disabled Packages To revert, just move the string to the place of origin with the correct name of the BPL. This goes for any other package (BPL) used by the IDE. NOTE: However, don't forget that the IDE will search for the reference in the RAD Studio master key ... thus, GetIT will still be loaded. Then, you will have to do the trick on both keys. In fact, RAD Studio saves somes user's definitions in files in the directories: 😄 \ Users \ MyPC2020Win \ AppData \ Local \ Embarcadero and 😄 \ Users \ MyPC2020Win \ AppData \ Roaming \ Embarcadero the latter being where you will have the files themselves! But that does not mean everything can be re-copied and everything will work as before! You can even make a backup of these two directories, for future use, in the event of a disaster, to assist in the correction! Anyway, you can make a backup of the keys in the Registry, and the directory on disk! If you want, do a test, deleting the entire key: Computer \ HKEY_CURRENT_USER \ SOFTWARE \ Embarcadero \ BDS \ 20.0 when you start the IDE again, you will see the message asking for your RAD Studio license (you can cancel this screen for dont change it), and, shortly thereafter, you will see the screens asking for the light or dark theme, and where you want to save your projects ... like the first IDE startup! This test I already did, and the result is like the first use of the IDE. If you want, you can also delete only the two keys: Computer \ HKEY_CURRENT_USER \ SOFTWARE \ Embarcadero \ BDS \ 20.0 \ Known IDE Packages and Computer \ HKEY_CURRENT_USER \ SOFTWARE \ Embarcadero \ BDS \ 20.0 \ Known Packages where the BPLs that will be loaded by the IDE are registered, and, if something was wrong in this definition, you will see the message asked to load (some) BPL the next time you start the IDE, or, if the entire key is deleted, the IDE will use the master key (Computer \ HKEY_LOCAL_MACHINE \ SOFTWARE \ WOW6432Node \ Embarcadero) and will not show any error messages! And everything will work as it did the first time.
×