?
Solved

Display menu with form

Posted on 2004-04-15
4
Medium Priority
?
546 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 800 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
Suggested Courses

752 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