Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8124977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:39:12+00:00 2026-06-06T06:39:12+00:00

How can I solve this problem Cannot Create Forms. No MDI forms are currently

  • 0

How can I solve this problem “Cannot Create Forms. No MDI forms are currently active”. I want to make a simple program that wod require a Login Form before it can acess the main form. I got three forms: Main Form (MDI Form), Form2 (MDIChild) and Login Form (Normal). Login form would appear first then the Main Form, then when I try to call on Form 2 from the Main form, an error would display “Cannot Create Forms. No MDI forms are currently active”.
I am using Delphi 7 on windows XP. I’m a beginner. Thank you very much sir.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T06:39:14+00:00Added an answer on June 6, 2026 at 6:39 am

    It sounds like you’re letting your LoginForm be auto-created, and it’s being created first. This won’t work, because the first form created by Application.CreateForm in the project file becomes the Application.MainForm. In order by be an MDI application, the MainForm must be a MDI parent window.

    The solution is usually to not auto-create your login form, and instead create it yourself. To do so, you need to edit your .dpr file (Project->View Source from the IDE’s main menu).

    Your project source should look something like this now (obviously, using your classes in the Application.CreateForm calls):

    begin
      Application.Initialize;
      Application.CreateForm(TLoginForm, LoginForm);
      Application.CreateForm(TMainForm, MainForm);
      Application.CreateForm(TChildForm, ChildForm);
      Application.Run;
    end.
    

    You need to modify it so that the LoginForm isn’t created first.

    var
      LoginOK: Boolean = False;
    
    begin
      LoginForm := TLoginForm.Create(nil);
      try
        // Show login form. When it closes, see if login worked.
        LoginForm.ShowModal;
        LoginOK := LoginForm.CanLogin; // However you know login is OK or not here
      finally
        LoginForm.Free;
      end;
      if not LoginOK then
        Halt;    // Login failed - terminate application.
      Application.Initialize;
      Application.CreateForm(TMainForm, MainForm);
      {
         I normally do not auto-create anything but the main form
         and maybe a datamodule (which you **can** autocreate first -
         it is not a form), but a MDI application is pretty useless
         without at least one open child window, IMO.
      }
      Application.CreateForm(TChildForm, ChildForm);
      Application.Run;
    end.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

just want to ask anyone here can solve this problem? I want to create
there's this interesting problem i can not solve myself. I will be very glad,
I can't solve this problem... I'm having some problems with fetched properties (not with
Can anybody help me to solve this problem. I am working on iphone development.
I've been trying to solve this problem for a while now and I can't
I've searched high and low in order to solve this problem, but I can't
I have worked on this problem for my entire day and can't solve it.
I researched this around and still can't seem to solve this problem. I have
i need your help badly because i cannot solve this problem on my own.
I know I've solved this problem before, but I can't remember or find the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.