Creating LCL Control From Libraries
From Lazarus wiki
Jump to navigationJump to search
About
Due to several problems, LCL components and ansistrings cannot be passed between a library (dll/so/dynlib) and an application (exe/app).
This interface provides a simple API between the library and the application to create LCL UI controls application-side, however controlled by dummies library-side.
LIBRARY EXAMPLE 1
procedure init; var myobj:TRHandle; begin
myobj:=RCreate(StrToRstr('TObject')); RSetStrProp(myobj,StrToRstr('MyStringProperty'),StrToRstr('Hello world!'));
end;
LIBRARY EXAMPLE 2
procedure init; var button:TRButton; begin
button:=TRButton.Create(RApplication); button.Caption:='Hello!'; button.Parent:=RParent;
end;
Copyright
Devised and created by Christian Sciberras, with the help of the following people from #lazarus-ide IRC (alphabetical):
- Andreas '\pub\bash0r' Schneider
- Dmitry 'skalogryz' Boyarintsev
- Marc 'giantm' Weustink
- Vincent 'fpcfan' Snijders
License
(C) 2009 Covac Software. You may copy, store, modify and sell this software as long as you keep copyright comments in the source code.