Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Freeing form variable
#3
(05-27-2022, 12:48 AM)Hi Alexandre,my IW version is 15.2.54 and I my delphi version is 11.1Following the code in my MoveToForm procedure:  TIWAppForm(WebApplication.ActiveForm).Release; Wrote:   var

    CartForm: TCartForm := TCartForm.CreateAndInit(WebApplication, FOrder);
  CartForm.Show;

I have no knowledge about the existence of WebApplication.ShowForm procedure, where is it documented ?

I create a form constructor to accept an object that will be managed inside the form so I don't believe I can show the form via the ShowForm procedure but if I can suggest me how.

Thank you for your support,
Davide


Alexandre MachadoSomething doesn't look correct in this scenario. What's your IW version?

TIWAppForm(WebApplication.ActiveForm).Release won't call the destructor of the form immediately, only after the whole response has been generated. It would be good to know exactly if somehow in your case the destructor is called *immediately* after the call to Release (and no other code runs in between).

Also where exactly is TIWAppForm(WebApplication.ActiveForm).Release in relation to the code that creates and shows a new form?

Why don't you try to use what IW has built-in, instead of writing lots of code yourself?

You can simply call:

WebApplication.ShowForm(TIWForm1, True, True);

The first parameter is the class of the form

The second is a flag indicating if the Active form must be released afterwards (exactly what you want)

The third is another flag indicating if any existing TIWForm1 instance can be used instead of creating a new one (in most cases, True is the adequate choice)
Reply


Messages In This Thread
Freeing form variable - by David1 - 05-23-2022, 08:28 AM
RE: Freeing form variable - by Alexandre Machado - 05-27-2022, 12:48 AM
RE: Freeing form variable - by David1 - 05-31-2022, 02:27 PM
RE: Freeing form variable - by David1 - 06-01-2022, 08:18 AM
RE: Freeing form variable - by Alexandre Machado - 06-03-2022, 10:37 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)