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 6804731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:30:08+00:00 2026-05-26T19:30:08+00:00

I am trying to make a modular application in delphi2010 using BPL. Problem is

  • 0

I am trying to make a modular application in delphi2010 using BPL.
Problem is When I try to create class within BPL, I get this error message.

enter image description here

I didn’t do any operation about resource (RES file)!

Procedure TControllerMain.Btn1OnClick(Sender: TObject);
type
  TInitProcedure = function: TModuleBaseClass; stdcall;
  TModuleBaseClass= class of TModuleBase;
var
  h: HMODULE;
  proc: TInitProcedure;
  vClass: TModuleBaseClass;
begin
  h := LoadPackage('test.bpl');
  @proc := GetProcAddress(h, 'InitializePlugin');
  vClass := proc();
  vClass.Create(nil);  // error here
  UnloadPackage(h);
end;

dll code

TModuleBase is a TCustomPanel

type
  TVLCVideo = class(TModuleBase)
  private
   ...
  public
   ...
  end;
function InitializePlugin: TModuleBaseClass; stdcall;


implementation
function InitializePlugin: TModuleBaseClass;
begin
  Result := TVLCVideo;
end;


exports
  InitializePlugin;

end.
  • 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-26T19:30:08+00:00Added an answer on May 26, 2026 at 7:30 pm

    The solution :

    I was use TCustomPanel for ancestor of TModulBase but I was seen the problem, Remy is right. and them I remove the ancestor class for replace with a interface and all of my another plugins have to use same interface (if you using this way with normal dll project you will get a different error! I was try 🙁 you have to use it with bpl (bpl is a dll too))

    PIModuleBase = ^IModulBase;
    
    IModulBase = interface 
       ...
    end;
    

    this Button click is a just sample you have to create a modul manager class

    Procedure TControllerMain.Btn1OnClick(Sender: TObject);
    type
      TInitProcedure = function: PIModuleBase; stdcall;
    
    var
      h: HMODULE;
      proc: TInitProcedure;
      vClass: PIModuleBase;
    begin
      h := LoadPackage('test.bpl');
      @proc := GetProcAddress(h, 'InitializePlugin');
      vClass := proc();
      vClass^.setParent(form1);
      vClass^.setPosition(0,0,100,100);
      vClass^.play(PChar('url of media'));  
      //UnloadPackage(h);
    end;
    
    
    
    type
      TVLCVideo = class(TCustomPanel, IModulBase)
      private
       ...
      public
       ...
      end;
    function InitializePlugin: PIModuleBase; stdcall;
    
    
    implementation
    function InitializePlugin: PIModuleBase;
    var
     v : TVLCVideo;
    begin
      v := TVLCVideo.Create(nil);
      Result := IModuleBase(v);
    end;
    
    
    exports
      InitializePlugin;
    
    end.
    

    Important things :

    You cannot import the interface library file to module package file directly or in main application project! you have to create a new bpl project for just interface and shared library files, and them you need to put it your module packages in requires section like as vlc,rtl.

    And you need to build main application with this interface package

    Build with runtime packages

    enter image description here

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

Sidebar

Related Questions

Trying to make a Grid Like this using java and I'm assuming a 2d
Trying to make a MySQL-based application support MS SQL, I ran into the following
I am developing an application using the wrong tools. I don't wish to get
I am trying to implement a modal window using jqModal plug-in. I make an
im trying make one replace in string from a array but this dont work
I'm trying make a <dl> to define the icons I am using on the
I'm trying to make a change to an old appengine application, but now after
I've been banging my head against a wall trying make this work for a
I am trying to create a modular structure that will eventually live inside another
trying to make a .bat script, and need to get some strings working properly.

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.