按照書上陳述句一字一句的寫,能運行就是點擊屬性選單后無法彈出對應的屬性表單對話框。
點了后還列印顯示propSheet()Failed...
uj5u.com熱心網友回復:
你的代碼怎么寫的?uj5u.com熱心網友回復:
主要還是要看下你的原始碼uj5u.com熱心網友回復:
// PropSheet.cpp : 實作檔案//
#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)
{
AddPage((CPropertyPage*)&m_p1);
AddPage((CPropertyPage*)&m_p2);
AddPage((CPropertyPage*)&m_p3);
}
CPropSheet::CPropSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
AddPage((CPropertyPage*)&m_p1);
AddPage((CPropertyPage*)&m_p2);
AddPage((CPropertyPage*)&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, &CPropView::OnPropertysheet)
END_MESSAGE_MAP()
// CPropView 構造/析構
CPropView::CPropView()
{
// TODO: 在此處添加構造代碼
}
CPropView::~CPropView()
{
}
BOOL CPropView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: 在此處通過修改
// CREATESTRUCT cs 來修改視窗類或樣式
return CView::PreCreateWindow(cs);
}
// CPropView 繪制
void CPropView::OnDraw(CDC* /*pDC*/)
{
CPropDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
// TODO: 在此處為本機資料添加繪制代碼
}
void CPropView::OnRButtonUp(UINT /* nFlags */, CPoint point)
{
ClientToScreen(&point);
OnContextMenu(this, point);
}
void CPropView::OnContextMenu(CWnd* /* pWnd */, CPoint point)
{
#ifndef SHARED_HANDLERS
theApp.GetContextMenuManager()->ShowPopupMenu(IDR_POPUP_EDIT, point.x, point.y, this, TRUE);
#endif
}
// CPropView 診斷
#ifdef _DEBUG
void CPropView::AssertValid() const
{
CView::AssertValid();
}
void CPropView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CPropDoc* CPropView::GetDocument() const // 非除錯版本是行內的
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CPropDoc)));
return (CPropDoc*)m_pDocument;
}
#endif //_DEBUG
// CPropView 訊息處理程式
void CPropView::OnPropertysheet()
{
// TODO: 在此添加命令處理程式代碼
CPropertySheet propSheet("單子");
propSheet.DoModal();
}
uj5u.com熱心網友回復:
運行后,點擊創建的那個選單項彈不出模態框,然后會列印
uj5u.com熱心網友回復:
重新做了三次,第三次莫名其妙的就成功了,沒有漏掉步驟前兩次,就是不成功,碰到的都是上述提出的問題轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/31912.html
標籤:基礎類
上一篇:實時作業系統RTX8.1在win7下不兼容,請問有rtx64 3.0版本的破解版嗎?
下一篇:VC環境中shellcode植入
