Solved

custom main frame

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
  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 …
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.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

864 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

23 Experts available now in Live!

Get 1:1 Help Now