Link to home
Start Free TrialLog in
Avatar of cula99
cula99

asked on

Calling function from Bpl

This is my Bpl:

unit GlobalUnit;


interface
uses ExtCtrls, Buttons;
//procedure vcPanelResize(Sender: TObject);

implementation

procedure vcPanelResize(Panel:TPanel);
var
  i,m,n:integer;
begin
  m:=1; n:=1;
  for i:=0 to Panel.ControlCount-1 do
    begin
      if Panel.Controls[i].ClassType=TBitBtn then
        begin
          with Panel.Controls[i] as TBitBtn do
            begin
              Top:=m;
              Left:=n;
              Width:=Panel.Width-2;
              m:=m+Height+1;
            end;
        end;
    end;
end;

exports
vcPanelResize name 'vcPanelResize';

end.

How can I call procedure vcPanelResize from my main program.
Avatar of 2266180
2266180
Flag of United States of America image

something like this:
uses GlobalUnit;

....
vcPanelResize(apanel);
make sure that the bpl is in the path of the program (can be current dir). for compiling, make sure tha bpl is in the lib path of the project
Avatar of cula99
cula99

ASKER

I can put it in my uses cloasu, but I cant call procedure later. I supouse, I didnt declare it well in bpl.

Cula
I never wrote a bpl :D (I know, some ppl might remain ... "amazed" (can't find the right word))
I'll do that in a few minutes and let you know my findings
Avatar of cula99

ASKER

10x:))
ASKER CERTIFIED SOLUTION
Avatar of 2266180
2266180
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cula99

ASKER

Its working perfectly. 10x one more time:)))
usually, when it works perfectly, you give an A ;) just for the future :)
Avatar of cula99

ASKER

its working perfectly but not as I wont it. Now I have to ship all bpls I used in program that is why B. It works perfectly but it is not the best solution.
well ... that is what build with runtime packages mean. I thought you know. the best solution is not to use runtime packages, I don't know of any way to use partly runtime packages, partly design packages. if you want to have some code "outside" and some compiled into the exe, then you will have to use dll's. there is no other way, AFAIK.
peace