Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6711577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:09:26+00:00 2026-05-26T08:09:26+00:00

I’m trying to write a plugin system for my application based on jvPlugin. I

  • 0

I’m trying to write a plugin system for my application based on jvPlugin. I create forms in the plugin dll, then reparent them into DevExpress docking controls. At first sight, it seems to work. The problem is that none of the controls on the dll forms ever receive focus. Also, when clicking on controls like TSplitter, a “Control ‘xxx’ has no parent window” exception is raised.

Here’s how I’m doing it (condensed version).

The plugin host implements an IPluginHost interface

  IPluginHost = interface
  ['{C0416F76-6824-45E7-8819-414AB8F39E19}']
    function AddDockingForm(AForm: TForm): TObject;
    function GetParentApplicationHandle: THandle;
  end;

The plugin implments an IMyPlugin interface

  IMyPlugin = interface
  ['{E5574F27-3130-4EB8-A8F4-F709422BB549}']
    procedure AddUIComponents;
  end;

The following event is called when the plugin is initialised:

procedure TMyPlugin.JvPlugInInitialize(Sender: TObject; var AllowLoad: Boolean);
var
  RealApplicationHandle: THandle;
begin
  if Supports(HostApplication.MainForm, IPluginHost, FPluginHost) then
  begin
    RealApplicationHandle := Application.Handle;
    Application.Handle := FPluginHost.GetParentApplicationHandle; // Returns Application.Handle from the host application
    try
      FMyPluginForm:= TMyPluginForm.Create(Application); // Plugin host app owns the form
    finally
      Application.Handle := RealApplicationHandle;
    end;
  end;
end;

When the plugin host has loaded I call IMyPlugin.AddUIComponents in my plugin. It’s implemented like this:

procedure TMyPlugin.AddUIComponents;
begin
  // Add the docking form
  FPluginHost.AddDockingForm(FMyPluginForm);
end;

AddDockingForm is implemented in the host like this:

function TfrmMyPluginHost.AddDockingForm(AForm: TForm): TObject;
var
  DockPanel: TdxDockPanel;
begin
  // Create a new dockpanel
  DockPanel := TdxDockPanel.Create(Self);
  DockPanel.Name := DPName;

  DockPanel.Height := AForm.Height;
  DockPanel.DockTo(dxDockSite1, dtBottom, 0);
  DockPanel.AutoHide := TRUE;

  // Rename the dock panel and parent the plugin
  DockPanel.Caption := AForm.Caption;
  DockPanel.Tag := Integer(AForm);

  AForm.Parent := DockPanel;
  AForm.BorderStyle := bsNone;
  AForm.Align := alClient;
  AForm.Show;

  FDockedPluginFormList.Add(AForm);

  Result := DockPanel;
end;

If I run the following function on any of the controls on the plugin form I see a list going all the way back to my host’s main form. Yet TSplitters tell me they have no parent window. How can this be?

function TfrmMyPlugin.GetParents(WC: TWinControl): String;
begin
  if (WC <> nil) and (WC is TWinControl) then
    Result := WC.Name + ' [' + WC.ClassName + '] - ' + GetParents(WC.Parent);
end;

I must be missing something somewhere. Anybody got any good ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:09:26+00:00Added an answer on May 26, 2026 at 8:09 am

    Build both the plugin and the host application with runtime packages.

    Without using runtime packages, the DLL uses a distinct copy of the RTL, VCL and any used units. For example, the DLL’s TForm class is not the same as the host’s TForm class (is operator fails across the host/DLL boundary and therefore a DLL control will not recognize host parent form as a valid instance of TForm), global variables like Application, Mouse, Screen are separate instances, you have two copies of RTTI, etc, etc.

    The VCL was simply not designed to be used like this.

    With runtime packages on, all the problems are solved and the plugin (either a runtime package itself or a DLL built with runtime packages) can integrate seamlessly with the host application using runtime packages.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I am currently running into a problem where an element is coming back from
I am trying to loop through a bunch of documents I have to put
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.