About the release of dynamic windows and themeengine

Source: Internet
Author: User
Questions about release of dynamic windows and themeengine VCL Component Development and Application
Http://www.delphi2007.net/DelphiVCL/html/delphi_20061221110256226.html
First, the first question
I have a dynamic query window form3. When I press button1 in form1, I create form3 and return the query database result to stringgrid1 on form3, when I click the form3 button1 (modalresult = mrok of form3.button1), I want to return the result to form1.edit1. text, the specific statement is as follows:
If query. frmquery. showmodal = mrok then begin
Showmessage ('20140901 ');
Edit1.text: = trim (query. frmquery. stringgrid1.cell [GlobleJ-1, query. frmquery. stringgrid1.row]);
End;

If you do not write action: = cafree in the close action of form3, the preceding statement is okay. If you write action: = cafree;, remove showmessage, however, when showmessage is added, an error is reported, which is a bit confusing. I am always confused here. Please help me explain why.

2nd problems: the above query window does not use themeengine. If I replace all the forms with themeengine, an error will be reported. The error prompt is as follows: project project1.exe raised exception class elisterror with message 'list Index out of bounds (-1) 'process stoped use step or run to continue.
Why?

Use the message communication mechanism between the two dialogs to ensure security.
Or change showmessage to application. showmessage ();

The second is that the index is out of bounds. Check the list subscript reference.

When action: = cafree is added, the form is released immediately after it is closed. If the form is closed, use the content in it. It is recommended that you do not add a release statement.

Can I refer to the following below in the list to explain more?

If frmquery has been released, the objects in it cannot be referenced.
As long as the object is present, you can debug it and check whether the reference is out of the range.

The subscript index in the list is based on 0. For example, there are 5 elements in the list, and the subscript ranges from 0 to 4.

Solve the problem. Thank you for the two upstairs.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.