Recent

Author Topic: [SOLVED] DLL Form  (Read 7162 times)

pmesquita

  • Jr. Member
  • **
  • Posts: 62
[SOLVED] DLL Form
« on: August 17, 2021, 02:16:51 pm »
Guys..

I'm trying to solve a rather trivial problem:
Form inside a DLL.

The problem is: I have a DLL that has a Form that asks a question and returns True or False... but I need it to be displayed in ShowModal. The problem starts because when calling the DLL function responsible for displaying the form it is superimposed on the application and I would like you to be superimposed on the form that called the application... because my application is MDI.

I tried to send the "Application" Handle to the DLL and associate it to the "Application" of the DLL but the Form is not displayed

The closest I got to a resolution is this link...
http://www.44342.com/delphi-f1278-t4782-p1.htm the form is created but is not displayed.

Any idea ?

Att,
Pablo Mesquita
« Last Edit: August 17, 2021, 06:56:21 pm by pmesquita »

balazsszekely

  • Guest
Re: DLL Form
« Reply #1 on: August 17, 2021, 02:57:04 pm »
Guys..

I'm trying to solve a rather trivial problem:
Form inside a DLL.

The problem is: I have a DLL that has a Form that asks a question and returns True or False... but I need it to be displayed in ShowModal. The problem starts because when calling the DLL function responsible for displaying the form it is superimposed on the application and I would like you to be superimposed on the form that called the application... because my application is MDI.

I tried to send the "Application" Handle to the DLL and associate it to the "Application" of the DLL but the Form is not displayed

The closest I got to a resolution is this link...
http://www.44342.com/delphi-f1278-t4782-p1.htm the form is created but is not displayed.

Any idea ?

Att,
Pablo Mesquita
Please try the attached example from the following post : https://forum.lazarus.freepascal.org/index.php/topic,53621.msg396954.html#msg396954

pmesquita

  • Jr. Member
  • **
  • Posts: 62
Re: DLL Form
« Reply #2 on: August 17, 2021, 05:18:56 pm »
Well then... I came across this example but I need the form to be modal and not like this in the example that the form is "inside" the panel or parent form... I need the MessageBox style but this form inside a DLL... or some other modularization idea... because I'm fragmenting some functions into dlls so I don't need to recompile the whole exe when I make a simple change...

balazsszekely

  • Guest
Re: DLL Form
« Reply #3 on: August 17, 2021, 06:20:49 pm »
Well then... I came across this example but I need the form to be modal and not like this in the example that the form is "inside" the panel or parent form... I need the MessageBox style but this form inside a DLL... or some other modularization idea... because I'm fragmenting some functions into dlls so I don't need to recompile the whole exe when I make a simple change...
Yes, but why didn't you modify the above example to behave like a ModalForm(see attached application)?
« Last Edit: August 17, 2021, 06:41:54 pm by GetMem »

pmesquita

  • Jr. Member
  • **
  • Posts: 62
Re: DLL Form
« Reply #4 on: August 17, 2021, 06:55:48 pm »
Dude... it worked perfectly...
Actually, I did more or less what you did but I was "hitting my head" with the fact of deactivating the parent form before calling the fom that is in the dll... I didn't think I would have to do this...
But now I've learned another EnableWindow function...

Thanks...

 

TinyPortal © 2005-2018