Solved

custom main frame

Posted on 1997-06-03
2
217 Views
Last Modified: 2010-04-10
Using:
** VC++ 4.0 std. ed.   with Win95
**My experience: new to C++ and the object oriented concept
  so please be specific and complete in your answer.
** My app:
          MDI  with an ODBC database with file support.

Normally, when this application starts up, the main frame (with standard menu and tool bar, etc.) appears with a child frame for displaying the components of the database.

but.......in my app.....

I want the main frame to have have NO MENU or TOOL BAR (nothing!, except maybe the close button ("X"), and a title bar). And instead of displaying the childframe with the database fields (controls), I want to first display a box (dialog) with 3-d buttons which will be the menu choices (it will take the place of  the standard menu). Each of these buttons will call the various tables of the database or other duties to be performed.

As I said above I'm new (and confused by this MFC), so tell me how to code and/or (what to cut out of the standard generated code) to make this happen.

Thanx, Pete
0
Comment
Question by:petlin
[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 Comments
 
LVL 4

Accepted Solution

by:
AVaulin earned 100 total points
ID: 1163817
You must refuse from document orientation to create main frame without menu and toolbar. BTW cut all code in CYourApp::InitInstance from AddDocTemplate to return TRUE and insert code like this:

CString str = AfxRegisterWndClass( CS_HREDRAW|CS_VREDRAW, LoadStandardCursor(IDC_ARROW), CBrush(RGB(255,255,255)), LoadIcon(IDR_MAINFRAME) );
CRect r;
r.left = r.top = 0; r.right = 640; r.bottom = 480;
m_pMainWnd = new CMainFrame;
((CMainFrame*)m_pMainWnd)->Create( str, "Window Name", WS_VISIBLE|WS_BORDER|WS_CAPTION, r );

To show dialog before showing main frame you must
1) create dialog resource with resource editor
2) create CYourDialog class with ClassWizard help
3) insert before this code CYourDialog::DoModal member like this:

CYourDialog().DoModal();

Good luck.
0
 

Author Comment

by:petlin
ID: 1163818
I'm not clear on the following:
you say:
"You must refuse from document orientation..." refuse?
do you mean when using appwizard to create app.? There's no menu option at this point.

also, point #3)
"insert this code CYourDialog::...",  insert where?

Thanx again,

0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
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 video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

739 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