Jump to content

Issue with calling forms


jaenzalo

Recommended Posts

Hi

There are two things i really need help with im using version 0.91.0.980

 

1.Theres an strange issue i need help with, i need to call forms several times on a frame or form a get a response from them on a single execution, i've managed to make this happen recovering the execution to the point where it started and controling where it showld continue, but somehow after i call a form any message or form is not displayed again. I've made a test case tho explain this better.

Test Case.rar

 

2.We have our reports on crystal reports, and we want to implement them here but when the report is loaded it shows and error saying that the report engine is not opened, but we dont know exactly if the problem is unigui or delphi itself because we usde before delphi 2005.

 

I'll really appreciate your help we are stucked on this, our proyect is working excelent on web thanks to your great tool.

Link to comment
Share on other sites

  • Administrators

Your code seems to be violating many basic rules of OO programming. You call global Form variables from inside an abstract Frame which may belong to any form at any moment. Your code is full of Boolean returning functions which call ShowModal in the most unexpected locations.(Even in exception handlers!)

 

I really couldn't realize why you need to code in such a complicated way. You've made many cross references between Global form objects which is very confusing.

 

In uniGUI FreeOnClose is True by default so any Form has a limited life cycle. When you close it Form is gone.

 

You mat try setting FreeOnClose to False for Forms other than UniForm1. It seems to solve your issue but I recommend to redesign your app and avoid direct access to global Form instances.

 

Also don't forget that Show and ShowModal are not blocking in web mode.

Link to comment
Share on other sites

Hi

There are two things i really need help with im using version 0.91.0.980

 

2.We have our reports on crystal reports, and we want to implement them here but when the report is loaded it shows and error saying that the report engine is not opened, but we dont know exactly if the problem is unigui or delphi itself because we usde before delphi 2005.

Hi,

 

I find that was due to Crystal Report VCL cannot be used in multi-threaded application, if you go through CRDynamic.pas you will find:

{ Set openEngineType to PE_OE_MULTI_THREADED if user calls CRPE from  }
{ a multi-threaded application. Once CRPE starts up in multi-threaded }
{ mode with PEOpenEngineEx, user should call PEOpenEngine or          }
{ PEOpenEngineEx to initialize CRPE for every thread that makes CRPE  }
{ API calls.                                                          }
{                                                                     }
{ Using PEOpenEngine () to start up CRPE, by default CRPE is in       }
{ single-threaded mode.                                               }

 

However, in implementation part of PEOpenEngineEx, you will find:

{------------------------------------------------------------------------------}
{ PEOpenEngineEx function                                                      }
{  - Not fully implemented in CRPE yet...                                      }
{------------------------------------------------------------------------------}

 

So Crystal Report VCL cannot be used under Multi-Threaded Applicaiton!

Link to comment
Share on other sites

Hi first, Thanks for the reply i know right now you're very busy i really thank you

 

Let me explain how our application works.

We have an menu on the MainForm it loads the options dynamically by reading the class name of the frame (originally on vcl the were forms but i didnt find any way to call them dynamically) on the database. Theses Forms are loaded on a single Form that contains them. 

So there a frames for each option and they are a lot, theses option are loaded according to the user's profile

 

 

Posted Today, 02:53 AM

Your code seems to be violating many basic rules of OO programming. You call global Form variables from inside an abstract Frame which may belong to any form at any moment.

 

In that case how could i know to wich frame return the execution, please if anyone could give me any suggestion I'll apreciate it

 

 

Your code is full of Boolean returning functions which call ShowModal in the most unexpected locations.(Even in exception handlers!) 

 

This specific Test case i sent is an example of the code of a form that is causing this trouble in the others it worked by this code structure

 

This form has and DBGrid on the left side, they are loans ready to be disbursed. With a Button you add them to a UniStringGrid where they are processed (may can be processed at once) and there the problem starts. Theres are more than one stringgrid (one for each disburse mode) in the button theres a call for a method that goes all over the string grid with a for and this one calls another that makes all the process for the current record and this one calls other that makes all the accounting part. In this part many forms have to be called in order to put the values for the document. 

 

Originally they where only procedures calling each other but i have to turn them into functions because the code have to be blocked at some point to call a Form to get some value with the boolean functions i control where to block when a form is called.

 

 

 

In uniGUI FreeOnClose is True by default so any Form has a limited life cycle. When you close it Form is gone.

 

You mat try setting FreeOnClose to False for Forms other than UniForm1. It seems to solve your issue but I recommend to redesign your app and avoid direct access to global Form instances.

 

Ok I'll Try that but i want to ask you somenthing when i close the form that contains the frames when lodaded some times i get an access violation on unit ext pascal it ocurrs some times. Could this be related to it?

 

and bessides why there where i put the comment no MessageDlg Or no showMessage is displayed again?

 

 

This is the issue im facing I'll really apreciate anyones help thanks

 

Link to comment
Share on other sites

 

Hi,

 

I find that was due to Crystal Report VCL cannot be used in multi-threaded application, if you go through CRDynamic.pas you will find:

{ Set openEngineType to PE_OE_MULTI_THREADED if user calls CRPE from }

{ a multi-threaded application. Once CRPE starts up in multi-threaded }

{ mode with PEOpenEngineEx, user should call PEOpenEngine or }

{ PEOpenEngineEx to initialize CRPE for every thread that makes CRPE }

{ API calls. }

{ }

{ Using PEOpenEngine () to start up CRPE, by default CRPE is in }

{ single-threaded mode. }

 

However, in implementation part of PEOpenEngineEx, you will find:

{------------------------------------------------------------------------------}

{ PEOpenEngineEx function }

{ - Not fully implemented in CRPE yet... }

{------------------------------------------------------------------------------}

 

So Crystal Report VCL cannot be used under Multi-Threaded Applicaiton!

 

Hi

Thanks a lot for the reply.

 

yes it was just what i was affraid, then what can i do in that case i was thinking two obtions eather find some way to miggrate them to fast reports (even if we have to do it ourselves without any program) or call a try icon application when reports are nedded that processes the report and turn it into html but i don't know if this could be possible, of course this application can't be multi-thread so what can you suggest me? 

 

Again thanks a lot i really apreciate your aid

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...