Home > Software engineering >  New people, learn Sun Xin Vc problem in-depth explanation chapter 8 add good properties form the men
New people, learn Sun Xin Vc problem in-depth explanation chapter 8 add good properties form the men

Time:11-22

According to the statement of word, the book can click on the properties menu after cannot run is corresponding to the attribute form dialog box,
Point after the print also shows propSheet () Failed...

CodePudding user response:

How do you write the code?

CodePudding user response:

Mainly to look at your source code

CodePudding user response:

//PropSheet. CPP: implementation file
//

# include "stdafx. H"
# include "Prop. H"
# include "PropSheet. H"
//CPropSheet

IMPLEMENT_DYNAMIC (CPropSheet CPropertySheet)

CPropSheet: : CPropSheet (UINT nIDCaption, CWnd * pParentWnd, UINT iSelectPage)
: CPropertySheet (nIDCaption pParentWnd, iSelectPage)
{

The AddPage ((CPropertyPage *) & amp; M_p1);
The AddPage ((CPropertyPage *) & amp; M_p2);
The AddPage ((CPropertyPage *) & amp; M_p3);
}
CPropSheet: : CPropSheet (LPCTSTR pszCaption, CWnd * pParentWnd, UINT iSelectPage)
: CPropertySheet (pszCaption pParentWnd, iSelectPage)
{

The AddPage ((CPropertyPage *) & amp; M_p1);
The AddPage ((CPropertyPage *) & amp; M_p2);
The AddPage ((CPropertyPage *) & amp; M_p3);
}
CPropSheet: : ~ CPropSheet ()
{
}
BEGIN_MESSAGE_MAP (CPropSheet CPropertySheet)
END_MESSAGE_MAP ()


# include "PropDoc. H"
# include "PropView. H"
# include "PropSheet. H"
# ifdef _DEBUG
# define new DEBUG_NEW
# endif
//CPropView
IMPLEMENT_DYNCREATE (CPropView, CView)

BEGIN_MESSAGE_MAP (CPropView, CView)
ON_WM_CONTEXTMENU ()
ON_WM_RBUTTONUP ()
ON_COMMAND (IDM_PROPERTYSHEET, & amp; CPropView: : OnPropertysheet)
END_MESSAGE_MAP ()

//CPropView structure/destructor

CPropView: : CPropView ()
{
//TODO: add construction code here

}
CPropView: : ~ CPropView ()
{
}
BOOL CPropView: : PreCreateWindow (CREATESTRUCT& Cs)
{
//TODO: here by modifying the
//cs to modify the CREATESTRUCT window class or style

Return the CView: : PreCreateWindow (cs);
}
//CPropView map

Void CPropView: : ontouch pDC (CDC */* */)
{
CPropDoc * pDoc=GetDocument ();
ASSERT_VALID (pDoc);
if (! PDoc)
return;

//TODO: here is the machine data add rendering code
}
Void CPropView: : OnRButtonUp (UINT nFlags *//* and CPoint point)
{
ClientToScreen (& amp; Point);
OnContextMenu (this point);
}

Void CPropView: : OnContextMenu (pWnd CWnd */* */, CPoint point)
{
# # ifndef SHARED_HANDLERS
TheApp. GetContextMenuManager () - & gt; ShowPopupMenu (IDR_POPUP_EDIT, point x, point y, this, TRUE);
# endif
}

//CPropView diagnosis

# ifdef _DEBUG
Void CPropView: : AssertValid (const)
{
The CView: : AssertValid ();
}
Void CPropView: : Dump (CDumpContext& Dc) const
{
The CView: : Dump (dc);
}

Const CPropDoc * CPropView: : GetDocument ()//a debug version is inline
{
ASSERT (m_pDocument - & gt; IsKindOf (RUNTIME_CLASS (CPropDoc)));
Return (CPropDoc *) m_pDocument;
}
# endif//_DEBUG
//CPropView message handler
Void CPropView: : OnPropertysheet ()
{
//TODO: add the command handler code
CPropertySheet propSheet (" list ");
PropSheet. DoModal ();
}


CodePudding user response:

After the operation, click create the menu items play out modal box, and then will print

CodePudding user response:

For three times, again the third time the puzzling to success, no missed step twice before, is not successful, met is the above questions
  • Related