Error Creating Window

Error Creating Window

In my Delphi 1.0 application, when I open a form (e.g. ClientForm.Show) I get an error message: “Error creating window.” This error occurs when several forms (nine or ten forms that manage Paradox tables) were previously “showed” then “closed.” An EOutofMemory exception is raised, but doing a MemAvail shows that 16 MB still remains in heap. I don’t know what the problem is.

Make sure that in the OnClose event of each of your forms, you put the following line:

Action := caFree;

This will make sure that the resources used by the form are freed up at close.

Also, check to see if your code opens up stuff like tables or queries without freeing them. For data access objects that are dropped on a form, they’ll get destroyed with the form. But if you’re creating tables or queries on the fly, then you have to explicitly free them.

See also  How College Students Can Shape the Future of Tech Responsibility

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist