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].ClassTyp e=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.
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].ClassTyp
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.
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
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
I'll do that in a few minutes and let you know my findings
ASKER
10x:))
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Its working perfectly. 10x one more time:)))
usually, when it works perfectly, you give an A ;) just for the future :)
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
peace
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