
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