creating Modal vs. Non-Modal dialogs 
Author Message
 creating Modal vs. Non-Modal dialogs

I've been working mainly in .NET and VBA and i'm looking to create two very
basic MFC dialogs. one needs to be Modal and the other needs to be
Non-Modal.

I've dabbled in MFC but to no great extent. the majority of my GUI
experiance is in .NET using C# and with VBA doing application specific
development.

In VBA this is a simple property setting in the dialog editor and takes no
thought at all, however i'm unable to located where to set this in MFC. I'm
assuming it's part of the WNDCLASS.style and one of these three options:
Overlapped, Popup, and Child.

i'm assuming that Child is not what i'm looking for as it is probably used
in MDI applications to behave as a MDI Child.

any help?

TIA




Sat, 27 Nov 2004 18:26:08 GMT  
 creating Modal vs. Non-Modal dialogs
Here is some pointers, in MFC modal dialogboxes are called up by calling
it's DoModal.  To make a dialog box modeless (Non-Modal) call the it's
Create function.  This way you can have the same dialog box as modal and
modeless.  It works the same way in the SDK.

This should get you pointed in the right direction. If you need more help
let me know.

Ali


Quote:
> I've been working mainly in .NET and VBA and i'm looking to create two
very
> basic MFC dialogs. one needs to be Modal and the other needs to be
> Non-Modal.

> I've dabbled in MFC but to no great extent. the majority of my GUI
> experiance is in .NET using C# and with VBA doing application specific
> development.

> In VBA this is a simple property setting in the dialog editor and takes no
> thought at all, however i'm unable to located where to set this in MFC.
I'm
> assuming it's part of the WNDCLASS.style and one of these three options:
> Overlapped, Popup, and Child.

> i'm assuming that Child is not what i'm looking for as it is probably used
> in MDI applications to behave as a MDI Child.

> any help?

> TIA





Sat, 27 Nov 2004 18:35:24 GMT  
 creating Modal vs. Non-Modal dialogs
as usual after i post something i seem to stumble uppon the answer...

CDialog.DoModal() seems to work alright.

- EM


Quote:
> I've been working mainly in .NET and VBA and i'm looking to create two
very
> basic MFC dialogs. one needs to be Modal and the other needs to be
> Non-Modal.

> I've dabbled in MFC but to no great extent. the majority of my GUI
> experiance is in .NET using C# and with VBA doing application specific
> development.

> In VBA this is a simple property setting in the dialog editor and takes no
> thought at all, however i'm unable to located where to set this in MFC.
I'm
> assuming it's part of the WNDCLASS.style and one of these three options:
> Overlapped, Popup, and Child.

> i'm assuming that Child is not what i'm looking for as it is probably used
> in MDI applications to behave as a MDI Child.

> any help?

> TIA





Sat, 27 Nov 2004 18:35:05 GMT  
 creating Modal vs. Non-Modal dialogs
i've got the Modal dialog working fine; however, when i goto create the
Modeless dialog i get an exception error. Perhaps i'm not approaching this
in the correct manner. What i'm currently doing is just using the MFC app
wizard and modifying it to use the .Create and .ShowWindow rather than the
.DoModal() in the method wich declares and creates the dialog.

I have an example of

Quote:
> Here is some pointers, in MFC modal dialogboxes are called up by calling
> it's DoModal.  To make a dialog box modeless (Non-Modal) call the it's
> Create function.  This way you can have the same dialog box as modal and
> modeless.  It works the same way in the SDK.

> This should get you pointed in the right direction. If you need more help
> let me know.

> Ali



> > I've been working mainly in .NET and VBA and i'm looking to create two
> very
> > basic MFC dialogs. one needs to be Modal and the other needs to be
> > Non-Modal.

> > I've dabbled in MFC but to no great extent. the majority of my GUI
> > experiance is in .NET using C# and with VBA doing application specific
> > development.

> > In VBA this is a simple property setting in the dialog editor and takes
no
> > thought at all, however i'm unable to located where to set this in MFC.
> I'm
> > assuming it's part of the WNDCLASS.style and one of these three options:
> > Overlapped, Popup, and Child.

> > i'm assuming that Child is not what i'm looking for as it is probably
used
> > in MDI applications to behave as a MDI Child.

> > any help?

> > TIA





Sat, 27 Nov 2004 19:51:52 GMT  
 creating Modal vs. Non-Modal dialogs
Well, if the dialog box is your apps main window, it shouldn't be a modeless
dialogbox, if you use a modeless dlg then exiting the app becomes more
involved.  But that's besides the point.
I really can't solve the problem unless I know what the exception is.  Keep
in mind that if you change the dialog to modeless then InitInstance needs to
return TRUE.
Here is one suggestion, create a dlg based app using the wizard. then open
up the file with your App class.
move the dlg declaration into the h file.
replace the line
 int nResponse = dlg.DoModal();
with
   dlg.Create(CYourDlg::IDD,NULL);
and return TRUE

Anyway, either include the exception or include the piece of code that
creates the dlg.

Ali


Quote:
> i've got the Modal dialog working fine; however, when i goto create the
> Modeless dialog i get an exception error. Perhaps i'm not approaching this
> in the correct manner. What i'm currently doing is just using the MFC app
> wizard and modifying it to use the .Create and .ShowWindow rather than the
> .DoModal() in the method wich declares and creates the dialog.

> I have an example of


> > Here is some pointers, in MFC modal dialogboxes are called up by calling
> > it's DoModal.  To make a dialog box modeless (Non-Modal) call the it's
> > Create function.  This way you can have the same dialog box as modal and
> > modeless.  It works the same way in the SDK.

> > This should get you pointed in the right direction. If you need more
help
> > let me know.

> > Ali



> > > I've been working mainly in .NET and VBA and i'm looking to create two
> > very
> > > basic MFC dialogs. one needs to be Modal and the other needs to be
> > > Non-Modal.

> > > I've dabbled in MFC but to no great extent. the majority of my GUI
> > > experiance is in .NET using C# and with VBA doing application specific
> > > development.

> > > In VBA this is a simple property setting in the dialog editor and
takes
> no
> > > thought at all, however i'm unable to located where to set this in
MFC.
> > I'm
> > > assuming it's part of the WNDCLASS.style and one of these three
options:
> > > Overlapped, Popup, and Child.

> > > i'm assuming that Child is not what i'm looking for as it is probably
> used
> > > in MDI applications to behave as a MDI Child.

> > > any help?

> > > TIA





Sat, 27 Nov 2004 20:23:06 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Create a non-modal dialog box

2. modal dialogs on top of modal dialogs...

3. Showing a modal dialog in a modal dialog application

4. modal dialog spawning a modal dialog

5. Modal dialog over a modal dialog ( How to...?)

6. Non MFC modal dialogs in an MFC application - Dialog Message problem

7. modal dialog not modal?

8. Modal dialog not acting modal

9. modal dialog to modal less

10. creating non-modal property sheet

11. VC++ ERROR WHEN CALLING NON-MODAL DIALOG IN VB6 DLL

12. Non modal Dialog

 

 
Powered by phpBB® Forum Software