window with emdeded dialog box

I need an application that shows window frame and an embedded dialog box:

1. no system menus and tool bars on the frame.

2. some user-defined menus and 2 buttons (say, BT1 and BT2) added onto the frame.

3. as BT1 is clicked, dialogbox1 is embeded and as BT2 is clicked, dialogbox2 is embeded.

I am not sure how to realize these requirements.

Thanks in advance for your help.
yingchunliAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

yingchunliAuthor Commented:
Edited text of question.
0
basantCommented:
Use FormViews.

Make 2 FormView.
On Click Menu Call
RemoveView and AddView

0
yingchunliAuthor Commented:
I cannot figure out how the answer fits the requirements in the question. It might be better to show how to do it step by step for the above requirements.
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

yingchunliAuthor Commented:
If these three requirements are not easy to fit, an answer to the  following one is also acceptable:

How to add menus to property sheet (step by step)?

0
Vinayak KumbarSr Program ManagerCommented:
Hi,

I have a sample workspace which I think will meet Ur requirement. Give me Ur emailID. I will sent U the required.

Try it out.
0
yingchunliAuthor Commented:
My email is: li@arc.ab.ca

0
Vinayak KumbarSr Program ManagerCommented:
Hi,

I have Sent U the ziped file.
Pls unzipi it, build it and run it.

Hope that satifies Ur requirement.

Cheers.
0
basantCommented:
My suggestion was :

You want to make propertys with menus!
right. I am saying that you make
a CFormView which is nothing but
embedding DialogBox in the View window
thus you will be having Dialog appeared
in the view. THose are not real
dialog boxes but MFC creates all equivalent windows as child windows of your view. You don't have to do anything for that.

To emulate Property sheet which is nothing but a collection of property pages ( prev Dialog Boxes) you can create multiple CFormViews. When you want to switch between two views, You destroy the previous view by RemoveView
and Add the New View by AddView Member functions. Thus propery sheets with property pages can be emulated using multiple CFormViews.

I don't think you have to work much. See the help on AddView in VC++, there is an example of doing that. If u r familiar with form views then that won't be any problem.
0
yingchunliAuthor Commented:
Thanks,  VinExpert:

your answer is very close to the one I wanted with one exception: as I decrease the size of the frame, the dialog box is outside the frame. I hope the dialog box(s) is "fixed" inside the view area of the frame.  To make the frame un-resizeable seems to be one of the solutions to this. (how to do it?)

Two additional questions:
(1) how to set dialog-box1 as the default in view area?
(2) how was the project workspace created (key steps)?  



Thanks also to basant.  I appreciate your suggestions but I have not figure it all out yet.
0
Vinayak KumbarSr Program ManagerCommented:
Hi,

To make It Non-Resizable, put the following code in CMainFrms PreCreateWindow() function
cs.style &= ~WS_SIZEBOX ;

Now to pop up Dialog Box1 as default in view area
Map OnInitialUpdate() function for View class and will look like

void CCiricReqtView::OnInitialUpdate()
{
      CFormView::OnInitialUpdate();
      
      //Pop Up The Dialog1 By Default.
      OnButton1();
      
}

Now project workspace creation steps:
1. As usual start creating a SDI app
2. Go to last step(step-6), click on view class in the list box
3. Select the base class for it as CFormView
4. Say OK and modify the code.

Thats it.
Hope that helps.
0
Vinayak KumbarSr Program ManagerCommented:
Hi,

There are Ok and Cancel buttons on the dialog. If user clicks any one of them, display will go blank!!?. If U dont want that, U have 2 solutions.
1. Remove those buttons.
2. On Ok or Cancel kill the application.

Try it out.
0
yingchunliAuthor Commented:

Thanks,   VinExpert

You answer works OK for me.  Please "answer" this question to get the points.
0
Vinayak KumbarSr Program ManagerCommented:
Hi,

I am happy as Ur problem is solved.
Thanks.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.