Click here to Skip to main content
15,911,715 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalclipboard Pin
albd16-Jul-04 3:13
albd16-Jul-04 3:13 
GeneralRe: clipboard Pin
vcplusplus16-Jul-04 3:31
vcplusplus16-Jul-04 3:31 
GeneralMultiple views in one frame Pin
Maarten Kools16-Jul-04 1:45
professionalMaarten Kools16-Jul-04 1:45 
GeneralRe: Multiple views in one frame Pin
Anonymous16-Jul-04 1:48
Anonymous16-Jul-04 1:48 
GeneralRe: Multiple views in one frame Pin
Maarten Kools16-Jul-04 2:03
professionalMaarten Kools16-Jul-04 2:03 
GeneralRe: Multiple views in one frame Pin
Bob Stanneveld16-Jul-04 2:51
Bob Stanneveld16-Jul-04 2:51 
GeneralRe: Multiple views in one frame Pin
peterchen16-Jul-04 3:15
peterchen16-Jul-04 3:15 
GeneralRe: Multiple views in one frame Pin
mostafa_pasha16-Jul-04 5:00
mostafa_pasha16-Jul-04 5:00 
To build an MDI application with two views
1. Build an MDI application by using MFC AppWizard. AppWizard will create a skeleton MDI application with a single view.
2. Add a new class derived from the CView class.
3. Add debug and nondebug versions of the GetDocument function.
Use the GetDocument functions from your existing view class as a model.
4. Include the header file for the document class in the source file of the new view class.
5. Place the command handlers in the CChildFrame class.
It is easier to access the view or the document from CChildFrame rather than from the view class. Use the CFrameWnd::GetActiveView and CFrameWnd::GetActiveDocument functions to access the views and the document.
6. Add a handler for the OnDraw event of the new view class.
At this point, you must decide whether you want users to select the type of view at application startup, or whether you want to have your application start with a default view. In either case, the user can select another view at run time.

void CMainFrame::OnWindowItalics()
{
if (0 == m_pItalicsTemplate)
{
m_pItalicsTemplate = new CMultiDocTemplate(
IDR_XXXXTYPE,
RUNTIME_CLASS(CXXXXViewsDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CItalicsView));
}

CMDIChildWnd* pActiveChild = MDIGetActive();
CDocument* pDocument;
if (NULL == pActiveChild ||
(pDocument = pActiveChild->GetActiveDocument()) == NULL)
{
TRACE0("Warning: No active document.\n");
AfxMessageBox(AFX_IDP_COMMAND_FAILURE);
return; // command failed
}

CFrameWnd* pFrame = m_pItalicsTemplate->
CreateNewFrame(pDocument, pActiveChild);
if (NULL == pFrame)
{
TRACE0("Warning: failed to create new frame.\n");
return; // command failed
}

m_pItalicsTemplate->InitialUpdateFrame(pFrame, pDocument);
}





GeneralMore problems with service pack 6 Pin
Salvador Dali16-Jul-04 0:26
Salvador Dali16-Jul-04 0:26 
GeneralXP Styles and HP_HEADERSORTARROW Pin
Paul Vickery16-Jul-04 0:24
professionalPaul Vickery16-Jul-04 0:24 
GeneralRe: XP Styles and HP_HEADERSORTARROW Pin
Paul Vickery16-Jul-04 1:19
professionalPaul Vickery16-Jul-04 1:19 
GeneralIDE/Editor and syntax highlighting Pin
Jörgen Sigvardsson16-Jul-04 0:07
Jörgen Sigvardsson16-Jul-04 0:07 
GeneralRe: IDE/Editor and syntax highlighting Pin
Johann Gerell16-Jul-04 0:32
Johann Gerell16-Jul-04 0:32 
QuestionWhich directory is my app running out of? Pin
Joel Holdsworth16-Jul-04 0:00
Joel Holdsworth16-Jul-04 0:00 
AnswerRe: Which directory is my app running out of? Pin
Antony M Kancidrowski16-Jul-04 0:31
Antony M Kancidrowski16-Jul-04 0:31 
GeneralRe: Which directory is my app running out of? Pin
David Crow16-Jul-04 2:52
David Crow16-Jul-04 2:52 
GeneralRe: Which directory is my app running out of? Pin
Antony M Kancidrowski16-Jul-04 5:35
Antony M Kancidrowski16-Jul-04 5:35 
GeneralRe: Which directory is my app running out of? Pin
bikram singh16-Jul-04 12:40
bikram singh16-Jul-04 12:40 
GeneralRe: Which directory is my app running out of? Pin
David Crow19-Jul-04 2:32
David Crow19-Jul-04 2:32 
AnswerRe: Which directory is my app running out of? Pin
Paul Vickery16-Jul-04 0:34
professionalPaul Vickery16-Jul-04 0:34 
AnswerRe: Which directory is my app running out of? Pin
peterchen16-Jul-04 2:07
peterchen16-Jul-04 2:07 
Questionhow to disable messagebox Pin
Member 101812815-Jul-04 23:58
Member 101812815-Jul-04 23:58 
AnswerRe: how to disable messagebox Pin
David Crow16-Jul-04 2:53
David Crow16-Jul-04 2:53 
AnswerRe: how to disable messagebox Pin
Maximilien16-Jul-04 3:15
Maximilien16-Jul-04 3:15 
AnswerRe: how to disable messagebox Pin
LegolasX17-Jul-04 3:54
LegolasX17-Jul-04 3:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.