15,978
社区成员
发帖
与我相关
我的任务
分享
CObject* p=NULL;
if(pMap)
{
ASSERT( (p = pMap->LookupPermanent(m_hWnd)) != NULL ||
(p = pMap->LookupTemporary(m_hWnd)) != NULL);
}
ASSERT((CWnd*)p == this); // must be us
// Note: if either of the above asserts fire and you are
// writing a multithreaded application, it is likely that
// you have passed a C++ object from one thread to another
// and have used that object in a way that was not intended.
// (only simple inline wrapper functions should be used)
//
// In general, CWnd objects should be passed by HWND from
// one thread to another. The receiving thread can wrap
// the HWND with a CWnd object by using CWnd::FromHandle.
//
// It is dangerous to pass C++ objects from one thread to
// another, unless the objects are designed to be used in
// such a manner.
}
ON_BN_CLICKED(IDC_BTN_OPENCFG, OnBtnOpenCFG)
void CGOTODlg::OnBtnOpenCFG()
{
HT_OpenCtrlPane();
TClose();
}
CParamSheet paramSheet;
paramSheet.DoModal();
CParamSheet::CParamSheet(CWnd* pParentWnd)
:CBCGPPropertySheet (IDS_CAPTION, pParentWnd)
{
BOOL b32BitIcons = globalData.bIsOSAlphaBlendingSupport;
if (globalData.m_nBitsPerPixel == 16)
{
// 32-bit icons in 16 bpp display mode
// are correctly displayed in WinXP only
OSVERSIONINFO osvi;
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
::GetVersionEx (&osvi);
b32BitIcons = (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT &&
(osvi.dwMajorVersion > 5 ||
(osvi.dwMajorVersion == 5 && osvi.dwMinorVersion >= 1)));
}
SetLook (CBCGPPropertySheet::PropSheetLook_OutlookBar);//PropSheetLook_OutlookBar);
SetIconsList (b32BitIcons ? IDB_SHEETICON32 : IDB_SHEETICON, 64);
AddPage(&m_nModePage);
AddPage(&m_nConfigPage);
AddPage(&m_nAlignPage);
// AddPage(&m_Page1);
m_pPrtParam = CPrinterParam::Create();
ASSERT(m_pPrtParam);
if(PRO_SEGMENT == m_pPrtParam->GetProPrinterMode())
{
m_pTemplatePage = NULL;
if(NULL != g_pTempLibInst)
{
TEMPPROC_MODELPAGE ProcAdd = NULL;
ProcAdd = (TEMPPROC_MODELPAGE)GetProcAddress(g_pTempLibInst, TEMPFUNC[TEMP_MODELPAGE]);
// If the function address is valid, call the function.
if(NULL != ProcAdd)
{
m_pTemplatePage = (ProcAdd)(m_pPrtParam->GetSystemOfUnit());
if(NULL == m_pTemplatePage)
AfxMessageBox("Temp_CreateModelPageDlg Failed");
}
else
{
AfxMessageBox("Get Temp_CreateModelPageDlg Address Failed");
}
}
AddPage(m_pTemplatePage);
}
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
CParamSheet::~CParamSheet()
{
if(PRO_SEGMENT == m_pPrtParam->GetProPrinterMode())
{
if(NULL != g_pTempLibInst)
{
TEMPPROC_DELMODELPAGE ProcAdd = NULL;
ProcAdd = (TEMPPROC_DELMODELPAGE)GetProcAddress(g_pTempLibInst, TEMPFUNC[TEMP_DELMODELPAGE]);
// If the function address is valid, call the function.
if(NULL != ProcAdd)
{
BOOL bRet = (ProcAdd)();
if(FALSE == bRet)
AfxMessageBox("Temp_DeleteModelPageDlg Failed");
}
else
{
AfxMessageBox("Get Temp_DeleteModelPageDlg Address Failed");
}
}
}
if(m_pPrtParam)
m_pPrtParam->Release();
}
BEGIN_MESSAGE_MAP(CParamSheet, CBCGPPropertySheet)
//{{AFX_MSG_MAP(CParamSheet)
ON_WM_QUERYDRAGICON()
ON_WM_SYSCOMMAND()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPrinterParamSheet message handlers
HCURSOR CParamSheet::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CParamSheet::OnSysCommand(UINT nID, LPARAM lParam)
{
// TODO: Add your message handler code here and/or call default
CBCGPPropertySheet::OnSysCommand(nID, lParam);
}
BOOL CParamSheet::OnInitDialog()
{
BOOL bResult = CBCGPPropertySheet::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
this->CenterWindow();
return bResult;
}
BOOL bResult = CBCGPPropertySheet::OnInitDialog();
就是这里出错了,CBCGPPropertySheet::OnInitDialog()是个虚函数,CBCGPPropertySheet继承CPropertySheet类,CPropertySheet继承CWnd类;也许是我跟得不对,能告诉我这么跟踪吗BOOL CParamSheet::OnInitDialog()
{
BOOL bResult = CBCGPPropertySheet::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
this->CenterWindow();
return bResult;
}