mierlp Posted August 20, 2018 Share Posted August 20, 2018 Hi For some reason i got these error message when compiling. See first attachment. The form is part of the project, See second image This is random, not always the same module ...or the project is to big with 152 .pas and .dfm files or it's a 'bug' ? I use Delphi Tokyo 10.2.2.and uniGui 1.10.0.1472 Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted August 20, 2018 Administrators Share Posted August 20, 2018 Hi, If one form links to another form then both forms must be open in IDE otherwise you get this error. Quote Link to comment Share on other sites More sharing options...
mierlp Posted August 20, 2018 Author Share Posted August 20, 2018 Hi Farshad Is this Delphi behavior or uniGui. Because i can't remember i have this with vcl applications Regards Peter Quote Link to comment Share on other sites More sharing options...
mierlp Posted August 21, 2018 Author Share Posted August 21, 2018 Hi Farshad Is also occurs when ALL forms are loaded in the IDE Regards Peter Quote Link to comment Share on other sites More sharing options...
mierlp Posted August 22, 2018 Author Share Posted August 22, 2018 See attachement. The file IS loaded in the IDE. I think the problem occurs when you link to a form which contains the datasourcewhich you use on this form. That's my situation. FormTableAdmission contains the datasources, FormTableAdmissionReport is linked to FormTableAdmission Quote Link to comment Share on other sites More sharing options...
TuanHoang Posted August 23, 2018 Share Posted August 23, 2018 Hello I have same problems too : http://forums.unigui.com/index.php?/topic/9587-error-link-to-module-unimainmodule-which-cannot-be-found/and It is random. Quote Link to comment Share on other sites More sharing options...
Harry Rogers Posted August 23, 2018 Share Posted August 23, 2018 I have recently had this for the first time. Don't ever remember seeing it previously in 20 plus years of Delphi use. Does appear to be related to adding a reference to a datasource on a different form. Quote Link to comment Share on other sites More sharing options...
mierlp Posted August 25, 2018 Author Share Posted August 25, 2018 Did someone has/found a solution because is a big issue The alternative (must try it) is to move the datasource to the datamodule. I don't have the problem creating the same application as a Windows vcl appliction. 1 Quote Link to comment Share on other sites More sharing options...
mierlp Posted August 26, 2018 Author Share Posted August 26, 2018 Did some test 4 forms and moved the datasources to the datamodule. In that case you don't get the error message The forms which still have the link to the form with the datasource the issueis still there. It's not the way i was hoping for...now i have a lot of working moving datasources to datamodules and normally you put datasources on the form, not on the datamodule. I hope Farshad is coming with a solution, i have created a ticketregarding this issue. I don't think it's a Delphi thing because my VLC application don't have there issues. And that are all application with datasources on the forms. Maybe others have a beter solutions... Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted August 27, 2018 Administrators Share Posted August 27, 2018 I know this problem can occur when you link one form to another component on another form. I discourage this design approach because in uniGUI forms are transient objects. You must use DataModules (which are created from uniGUI wizard) for this purpose. Using forms may cause erratic behavior because in uniGUI forms are destroyed as soon as they are closed. After all, I don't think this design approach is encouraged in VCL too. DataModules are designed for this specific purpose. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted August 27, 2018 Administrators Share Posted August 27, 2018 Did some test 4 forms and moved the datasources to the datamodule. In that case you don't get the error message The forms which still have the link to the form with the datasource the issue is still there. It's not the way i was hoping for...now i have a lot of working moving datasources to datamodules and normally you put datasources on the form, not on the datamodule. I hope Farshad is coming with a solution, i have created a ticket regarding this issue. I don't think it's a Delphi thing because my VLC application don't have there issues. And that are all application with datasources on the forms. Maybe others have a beter solutions... If data aware component is on Form A and its datasource is on Form B then move datasource to Form A. If datasource is commonly used by more than one form then move it to a DataModule. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted August 27, 2018 Administrators Share Posted August 27, 2018 Please take this into account that in Delphi forms are always available. In uniGUI they are created on demand and destroyed when no longer needed Quote Link to comment Share on other sites More sharing options...
mierlp Posted August 28, 2018 Author Share Posted August 28, 2018 Thank you Farshad. That clarifies the case for me and the other forum members who have this issue. 1 Quote Link to comment Share on other sites More sharing options...
Ron Posted August 28, 2018 Share Posted August 28, 2018 If data aware component is on Form A and its datasource is on Form B then move datasource to Form A. If datasource is commonly used by more than one form then move it to a DataModule. I agree, this is the approach I always use: datasource on the same form as data aware component. I also - in OnCreate on all forms - assign the database to the queries programmatically, as these did get lost. I also open the MainModule - which has the database all other forms link to - before I open other forms, at project load. Doing this, I never get this link issue mentioned above, and it all works perfectly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.