0

How can i display a dialog window with adding a class to it and using the following to invoke it:

CClasX dlg(this);
dlg.DoModal();

I know you can do it without a class but im not sure how.
And second why would you want to invoke a dialog without a class - are they advantages?

Thanks

3
Contributors
2
Replies
3
Views
11 Years
Discussion Span
Last Post by Ancient Dragon
0

> How can i display a dialog window with adding a class to it
Just derive your CClasX from a CDialogBox and add what you want in the OnInitDialog function.
Without deriving from MFC, there is an api call I think, you can check the MFC source.
>why would you want to invoke a dialog without a class
If you have nothing to add to that dialog by inheriting from the base class, there is no advantage in using the MFC class. Without a clas you will save a little overhead, but this is just noise in the big scheme..

0

This is a good tutorial about how to write non-MFC programs. It shows you how to create dialog boxes from scratch. You could integrate some of it into an MFC program if you want. And here is a good non-MFC XMessageBox that can be easily added to an MFC program (I have already done that), and it works very well.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.