Solved

Display menu with form

Posted on 2004-04-15
4
530 Views
Last Modified: 2012-06-27
Hello Experts,
I'm new in VC++.
I created an MFC application (in .Net 2002 unmanaged C++) as SDI and added a resource form (IDD_FORMVIEW).
Now I want that after starting the application the menu with the form is displayed.
Actually only the menu and the toolbar is displayed.
If anyone knows what I need to do,
please supply an appropriate information.

Thank you for any help.

  HStrix
0
Comment
Question by:HStrix
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 13

Expert Comment

by:SteH
ID: 10831651
Is the view of that app derived from CFormView? In that case it should be done automatically. Otherwise you can create a new project where you select within the appwizard that the view is derived from CFormView. That way it will start automatically with that view. Otherwise you need to add a class to the form (IDD_FORMVIEW) derived from CFormView. And now you need to replace all calls to the old view class with that new one. Decide yourself which way is faster.
0
 

Author Comment

by:HStrix
ID: 10831788
Thank you SteH,
I created the MFC environment,
then I added the resource using IDD_FORMVIEW.
Now clicking the right mouse on the form I created a new class
called CMyForm based on CFormView (ID=IDD_FORMVIEW).
But the result is still unchanged.
I did not change anything to the "old view class", is it CFormView?
I found CFormView only in my new class.

  HStrix
0
 
LVL 13

Accepted Solution

by:
SteH earned 200 total points
ID: 10831857
When you used the appwizard to create a new MFC executable on the first page you can select SDI. On the sixth page you can select the base class to be CFormView where it seems that you selected CView. That gives you 4 classes in your class browser:
CYourApp
CYourView
CMainFrame
CYourDoc

You need to replace all occurences of CYourView whihc was derived from CView with CMyForm. These replaces should be in CYourApp and CYourDlg. Only after these steps CMyForm class will the used as view.
0
 

Author Comment

by:HStrix
ID: 10831964
Thank you SteH,
now I modified inside CYourApp the line
  RUNTIME_CLASS(CYourView));
to
  RUNTIME_CLASS(CMyForm));
and added the header file MyForm.h.
And - it works as expected.

Again, thank you very much.

  HStrix
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Find boost header files using gnu make (MinGW) on Win 7 11 108
C++ mouse_event mouse look 7 131
show out valin of json for debugging in visaul c++ 1 54
C++ Code Issue 4 47
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question