Solved

custom main frame

Posted on 1997-06-03
2
189 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
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

  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 …
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
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 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.

708 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now