MDI Frame Win Close Crash - Cannot Create Form. No MDI Forms are currently active

MDI Frame Win Close Crash - Cannot Create Form. No MDI Forms are currently active

Post by Steven Elwe » Fri, 11 Oct 1996 04:00:00



When I have any MDI Child windows open, and Close the the MDI Frame
window, I get this message:

'Cannot Create Form. No MDI Forms are currently active'

Well I would hope so, that's what anyone 'windows programmer' would
want.

The correct behavior should be for the MDI Frame window to query each
MDI Child window, and if all children allow closing, the MDI Frame
window closes.  

What hand-holding backward-philosophy is Borland using her?  

-- The 'I am just dying to automatically create a window for you'
philosophy <g>?

Wouldn't it be great if Borland would simply allow us to 'write'
traditional Windows software instead of trying to hold our hands
always?

In all my windows (in a subclass) I always use the FormClose event to
set Action:TCloseAction to caClose, as Borland should have defaulted
to.

I am using Delphi 2.01.
I create my own MDI Child windows, no autocreate.

Thanks in advance,

--------------------------------------------------------
Steven Elwell
Miami, Florida

--- EMail Addresses ----------------------


 
 
 

MDI Frame Win Close Crash - Cannot Create Form. No MDI Forms are currently active

Post by Svein Olav Mytti » Wed, 16 Oct 1996 04:00:00




> When I have any MDI Child windows open, and Close the the MDI Frame
> window, I get this message:

> 'Cannot Create Form. No MDI Forms are currently active'

> Well I would hope so, that's what anyone 'windows programmer' would
> want.

> The correct behavior should be for the MDI Frame window to query each
> MDI Child window, and if all children allow closing, the MDI Frame
> window closes.  

> What hand-holding backward-philosophy is Borland using her?  

> -- The 'I am just dying to automatically create a window for you'
> philosophy <g>?

> Wouldn't it be great if Borland would simply allow us to 'write'
> traditional Windows software instead of trying to hold our hands
> always?

> In all my windows (in a subclass) I always use the FormClose event to
> set Action:TCloseAction to caClose, as Borland should have defaulted
> to.

> I am using Delphi 2.01.
> I create my own MDI Child windows, no autocreate.

> Thanks in advance,

> --------------------------------------------------------
> Steven Elwell
> Miami, Florida

> --- EMail Addresses ----------------------



Don't know if this helps, but I have found out that when closing
the frame window, any code in the OnClose event of MDI children will NOT
be executed. Not at all.

And I believe the general tip is to use caFree instead of caClose.



 
 
 

MDI Frame Win Close Crash - Cannot Create Form. No MDI Forms are currently active

Post by Steven Elwe » Wed, 23 Oct 1996 04:00:00






>> When I have any MDI Child windows open, and Close the the MDI Frame
>> window, I get this message:

>> 'Cannot Create Form. No MDI Forms are currently active'

>> Well I would hope so, that's what anyone 'windows programmer' would
>> want.

>> The correct behavior should be for the MDI Frame window to query each
>> MDI Child window, and if all children allow closing, the MDI Frame
>> window closes.  

>> What hand-holding backward-philosophy is Borland using her?  

>> -- The 'I am just dying to automatically create a window for you'
>> philosophy <g>?

>> Wouldn't it be great if Borland would simply allow us to 'write'
>> traditional Windows software instead of trying to hold our hands
>> always?

>> In all my windows (in a subclass) I always use the FormClose event to
>> set Action:TCloseAction to caClose, as Borland should have defaulted
>> to.

>> I am using Delphi 2.01.
>> I create my own MDI Child windows, no autocreate.

>> Thanks in advance,

>> --------------------------------------------------------
>> Steven Elwell
>> Miami, Florida

>> --- EMail Addresses ----------------------


>Don't know if this helps, but I have found out that when closing
>the frame window, any code in the OnClose event of MDI children will NOT
>be executed. Not at all.

>And I believe the general tip is to use caFree instead of caClose.



I think my OnClose events work.  Are you talking about 32-bit?  That's
what I use.  No 16-bit unless I am forced to.

I use caFree - exclusively.  Any other concept makes little sense to
me.  I create my MDIChild windows and never let their autocreate do
it.  Still when closing the frame, with 1 or more children open, I get
the message.  Maybe I am missing some Delphi concept.  I'll map it all
out when I have the time.

My solution was to totally ignore all of the QueryClose stuff built
into Delphi and use FormClose in my MDIFrame class to control the
shutting down of MDIChild windows.  In my MDIFrame's FormClose event
handler, I query my children, configurable to the concepts of:
CloseIfAllOK (default behavior - all must say it is OK)
CloseAllOK (Close all that are OK, if any remaining then we can't
close)
CloseAllWhileOK (keep asking and closing until done or 1 says NO)

My MDIChild class has a property called Dirty, so that's what I query
in MDIFrame.  If it is TRUE, the I call MDIChild.OKToClose().

If I can close the MDIFrame window, I set the MDIFrame's
OnClose:Action to caFree, otherwise I set it to caNone.  This is the
way Win API apps typically close.  I don't know why my apps are
behaving differently.  Maybe I am doing something anti-Delphi.

If you have similar problems, I could send you the code, maybe twenty
total lines to get it all working as one would expect.

Good luck,

 
 
 

1. Q:non-MDI form to update MDI form

    How can i send info. from a non-MDI form in my program to a MDI
form?  Example:  one form has a list of names in a database.  on this
form with the names, the user selects the name they want and clicks the
command button to update the form to give more info. on the name the
user selected.

Jereme

2. Filemaker for Win CE

3. Accessing Objects on a Mdi Parent form from a Mdi Child form

4. Encryption in DBase

5. MDI problem, com MDI to MDI-child

6. MSDE 1.0 install fails

7. Closing MDI forms

8. Beginner Question

9. MDI and closing forms

10. making a mdi form a form during run time with click event

11. How can MDI child forms have child forms ?

12. Putting a form in a form without MDI

13. Launching new bound form from MDI form troubles