View Issue Details

IDProjectCategoryView StatusLast Update
0001866LazarusLCLpublic2016-05-11 07:58
ReporterPaul HAssigned ToOndrej Pokorny 
Status resolvedResolutionfixed 
PlatformWin32OSXPOS VersionSP2
Product Version0.9.12Product Build 
Target VersionFixed in Version 
Summary0001866: LCL not fully supported in library applications (.dlls) - Plug-in applications with GUI not working.
DescriptionMaking a .dll that has a user interface (under Win32) is not working. Application is not initialized and widgets don't respond.

This makes creating plug-ins (with UI) of any kind close to impossible.
Tagsdll, library
Fixed in Revision
Attached Files


duplicate of 0007182 resolvedOndrej Pokorny Problems using LCL in DLL 
duplicate of 0007181 resolvedBart Broersma Problems using LCL in DLL 
related to 0026439 resolvedJuha Manninen GlobalIdentToInt causes shared library to enter zombie state 


Felipe Monteiro de Carvalho

2007-11-27 13:39

developer   ~0016416

Please send a compilable example.

Markus Müller

2012-04-30 19:06

reporter   ~0059131


I can need it. When it is implemented, then I want test.

Anton Kavalenka

2012-04-30 19:14

reporter   ~0059132

There are partial solutions in 0007182 and 0007181

Markus Müller

2012-05-01 07:29

reporter   ~0059155

Yes, works!

Ondrej Pokorny

2016-05-10 23:58

reporter   ~0092508

It is possible in Lazarus 1.7. See

Everybody is welcome to donate bounties (if still interested) to Lazarus ;)

Balázs Székely

2016-05-11 07:13

developer   ~0092515

Nice example! In addition, I would load the library dynamically. This method it's
particularly useful for implementing plugins or modules, because they permit waiting to load the plugin/module until it's needed.

1. Add dynlibs to uses clauses. Instead of:
  DLLDialogLib = 'DLLDialog.dll';
  DLLDialogLib = '';

you can write:
  DLLDialogLib = 'DLLDialog.' + SharedSuffix;

2. Load the dll dynamically(based on the wiki example "program MainApp"):
  TDLLDialog_Init = procedure(DisableFormsCallBack, EnableFormsCallback: TEnableDisableFormsCallBack);
  LibHandle: TLibHandle = NilHandle;
  LibName: String;
  FarProc: TFarProc;
  DLLDialog_Init: TDLLDialog_Init;
  Application.CreateForm(TMainForm, MainForm);

  LibName := ExtractFilePath(ParamStr(0)) + DLLDialogLib;
  LibHandle := LoadLibrary(LibName);
  if LibHandle <> NilHandle then
    FarProc := GetProcedureAddress(LibHandle, 'DLLDialog_Init');
    if FarProc <> nil then
      DLLDialog_Init := TDLLDialog_Init(FarProc);
      DLLDialog_Init(@DisableFormsCallBack, @EnableFormsCallback);


Ondrej Pokorny

2016-05-11 07:38

reporter   ~0092516

1. Good, didn't know that.
2. The example is about how to get the LCL working from a library and not how to load a library dynamically. But you are welcome to adapt the wiki example if you want to :)

Balázs Székely

2016-05-11 07:58

developer   ~0092518

>>get the LCL working from a library and not how to load a library dynamically
I'm aware of that, but the LCL has worked inside a library since a long time ago(at least in the way I needed) plus usually you need lcl in lib. mostly for plugins/modules.,30252.msg192411.html#msg192411

>>But you are welcome to adapt the wiki example if you want to :)
This is a good idea! I will adapt it later!

Issue History

Date Modified Username Field Change
2006-03-14 12:21 Paul H New Issue
2006-03-14 12:21 Paul H Widgetset => Win32
2006-03-14 13:56 Vincent Snijders Target => post 1.0
2006-03-14 13:56 Vincent Snijders Status new => acknowledged
2007-11-27 13:39 Felipe Monteiro de Carvalho Note Added: 0016416
2007-11-27 15:08 Felipe Monteiro de Carvalho Relationship added duplicate of 0007182
2007-11-27 15:08 Felipe Monteiro de Carvalho Relationship added duplicate of 0007181
2012-02-04 12:02 Zeljan Rikalo LazTarget post 1.0 => 1.2
2012-04-30 19:06 Markus Müller Note Added: 0059131
2012-04-30 19:14 Anton Kavalenka Note Added: 0059132
2012-05-01 07:29 Markus Müller Note Added: 0059155
2014-01-14 15:16 Martin Friebe LazTarget 1.2 => 1.4
2014-07-01 20:16 Juha Manninen Relationship added related to 0026439
2014-10-01 10:22 Reinier Olislagers Tag Attached: dll
2014-10-01 10:22 Reinier Olislagers Tag Attached: library
2015-04-27 21:59 Juha Manninen LazTarget 1.4 => -
2016-05-10 23:58 Ondrej Pokorny Note Added: 0092508
2016-05-10 23:58 Ondrej Pokorny Status acknowledged => resolved
2016-05-10 23:58 Ondrej Pokorny Resolution open => fixed
2016-05-10 23:58 Ondrej Pokorny Assigned To => Ondrej Pokorny
2016-05-11 07:13 Balázs Székely Note Added: 0092515
2016-05-11 07:38 Ondrej Pokorny Note Added: 0092516
2016-05-11 07:58 Balázs Székely Note Added: 0092518