03-05-2025, 11:54 PM
I have a theory on this. I think this code in the IWAppFormCreate event:
is the problem as it's the C++ way but not the IW way. IW will create these forms on demand by something like WebApplication->GoToURL("/paypalForm") if you use SetURL or WebApplication->ShowForm(__classid(TpaypalForm),false,true), etc.
If you are creating these forms ahead of time to be able to access them via the variables you created for future reference it might just be 'accidentally' working most of the time for you.
If you remove the pre-creating form code from IWAppFormCreate and access your other forms something like this:
it may always work correctly without affecting the session.
Code:
wakoForm = new TwakoForm(this);
adrForm = new TadrForm(this);
...is the problem as it's the C++ way but not the IW way. IW will create these forms on demand by something like WebApplication->GoToURL("/paypalForm") if you use SetURL or WebApplication->ShowForm(__classid(TpaypalForm),false,true), etc.
If you are creating these forms ahead of time to be able to access them via the variables you created for future reference it might just be 'accidentally' working most of the time for you.
If you remove the pre-creating form code from IWAppFormCreate and access your other forms something like this:
Code:
TpaypalForm *f = dynamic_cast<TpaypalForm *>(WebApplication->FindFormByName("paypalForm"));
if(f) { f->Show(); } else { new TpaypalForm(WebApplication)->Show(); }it may always work correctly without affecting the session.

