Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

custom main frame

Posted on 1997-06-03
2
Medium Priority
?
220 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 300 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

715 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