Downloading Delphi Object Runtime Using BPL

I have a class in a block. Usually, when I change the algorithm of my methods, I have to recompile it and deliver the patch as a whole. I think to instantiate a class using a DLL. After searching delphi.about.com, I found that instead of using the DLL, I can use the BPL. This is a DLL for Delphi. The problem is that almost all the examples I found speak only about exporting a function. I want to dynamically load the BPL, and whenever I replace the BPL, I can get the latest class algorithm, not just the functions that I export.

The article I read:
- http://delphi.about.com/od/objectpascalide/a/bpl_vs_dll.htm
- Plugin system for Delphi application - bpl vs dll?
- http://delphi.about.com/library/weekly/aa012301a.htm

Any URL or SAMPLE is welcome to create a BPL from scratch to encapsulate a component or class.


Dear Guru,

Suppose I have this code:

unit unitA;

interface

type
  B = class(TObject)
  public
    procedure HelloB;
  end;

  A = class(TObject)
  public
    function GetB: B;
    function HelloA: String;
    procedure Help;
  end;

  implementation

  uses
      Dialogs;

  { B }

   procedure B.HelloB;
   begin
     ShowMessage('B');
   end;

  { A }

  function A.GetB: B;
  begin
    Result := B.Create;
  end;

  function A.HelloA: String;
  begin
    Result := 'Hello, this is A';
  end;

  procedure A.Help;
  begin
    //do something
  end;

  end.

I want to export all public methods A. How to make it a DLL? How to use it from another device, where to import it? let's say:

 var a: A;

 a := A.Create;
 a.GetB;
 showMessage(a.HelloA);

A is not declared in the block (it is in the DLL). Please inform.


Hurray. I got it last night. All I have to do is make the object an implemented interface, which is used in the caller's block to catch an instance of the object returned by the DLL.

Thanks to everyone.

+3
6

, , . , , , , .

, , , , , , , - DLL , . , , , .

+2

, , BPL , . BPL - IDE Delphi , RTL. ( BPL)

, , . IDE, RTL VCL .

DLL, RTL, VCL .

, DLL (++, #, FPC, Delphi) . , , , Delphi Delphi.

+4

, , - . , , .

, . . " " , .

EXE. , . " " EXE. , . RTL VCL, , .

, .

, . . , BPL EXE. EXE - .

+2

Delphi DLL BPL .

, ( , ), Delphi .bpl. Delphi .

, Delphi 4, , , .bpls. , , , , . , Delphi .

( , ) .

about.com, : ; BPL - DLL !

0

BPL . , , , Erp, BPL.

, BPL . BPL .

0

All Articles