Select Class View from the View menu.
Right click on the root node (DbQuery) and select Add, then Class.
Select MFC in the left tree, and MFC Class from the right list box.
In the MFC Add Class Wizard, enter CRecordStatusMDIChildWnd for the Name.
In the MFC Add Class Wizard, specify CMDIChildWnd for the Base class.
Click Finish to generate the class files.
Right click CRecordStatusMDIChildWnd in Class view, and select Properties.
Click on overrides and select OnCreateClient in the list.
Pull down the combobox and select <Add> OnCreateClient in the Messages dropdown.
Change OnCreateClient() as follows:
BOOL CRecordStatusMDIChildWnd::OnCreateClient( LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext) { return m_wndRecordInfo.Create(this, pContext); } |
Open RecordStatusMDIChildWnd.h and insert the following into the attributes section of the class:
CGXRecordInfoWnd m_wndRecordInfo; |
Save and close RecordStatusMDIChildWnd.h and RecordStatusMDIChildWnd.cpp.
Open DbQuery.cpp.
Add
#include "RecordStatusMDIChildWnd.h" |
after
#include "DbQueryView.h" |
Search for:
pDocTemplate = new CMultiDocTemplate( IDR_DBQUERTYPE, RUNTIME_CLASS(CDbQueryDoc), RUNTIME_CLASS(CChildFrame), // custom MDI child frame RUNTIME_CLASS(CDbQueryView)); AddDocTemplate(pDocTemplate); |
and replace it with:
pDocTemplate = new CMultiDocTemplate( IDR_DBQUERTYPE, RUNTIME_CLASS(CDbQueryDoc), RUNTIME_CLASS(CRecordStatusMDIChildWnd), RUNTIME_CLASS(CDbQueryView)); AddDocTemplate(pDocTemplate); |
Now, you can compile the application and run it.
Compile the application and run it.
Note the record number at the bottom of the window.
Congratulations on completing the DdQuery tutorial. For more information try these other tutorials:
Copyright © Rogue Wave Software, Inc. All Rights Reserved.
The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.