[SOLVED] Calling component from library lazarus / 31-LCL ---------------------------------------------------------------------- SaraT · 2023-04-07 01:42 Guys, I am trying to create a visual control form a dll. The below code does not display any error but the controls is not shown in the parent control. Function from file dll: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function CreateMyForm(aHandle : HWND) : boolean; stdCall;var  myForm : TForm;begin  result := false;  myForm:=TForm.Create(nil);  myForm.ParentWindow:=aHandle;  myForm.Width:=200;  myForm.Height:=200;  myForm.Show;  result := true;end; Calling the function: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function CreateMyForm(aHandle : HWND) : boolean; stdCall; External 'myFileDll.dll'; //OnClick buttonbegin  CreateMyForm(Panel1.Handle);end; Yes, I need this homework from a dll file. I would be so thank full if any help is provided. Edit: Thanks a lot for your help, guys!!! ---------------------------------------------------------------------- Zvoni · 2023-04-07 05:43 Local scope of myForm? ---------------------------------------------------------------------- SaraT · 2023-04-07 07:36 Quote from: Zvoni on April 07, 2023, 07:43:55 amLocal scope of myForm? Hi Zvoni What's that? How can I do that? Maybe someone else can test my code and help me to find a solution. Thanks guys ---------------------------------------------------------------------- balazsszekely · 2023-04-07 08:20 @SaraT You need an Application.Initialize before creating the dll form. See here: https://forum.lazarus.freepascal.org/index.php/topic,53621.msg39 6954.html#msg396954 Also read this: https://wiki.freepascal.org/Form_in_DLL ---------------------------------------------------------------------- Zvoni · 2023-04-07 11:02 Quote from: SaraT on April 07, 2023, 09:36:13 amQuote from: Zvoni on April 07, 2023, 07:43:55 amLocal scope of myForm? Hi Zvoni What's that? How can I do that? Maybe someone else can test my code and help me to find a solution. Thanks guys  Forget what i wrote. GetMem gave you all necessary links