这篇教程C++ ASSERT_KINDOF函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ASSERT_KINDOF函数的典型用法代码示例。如果您正苦于以下问题:C++ ASSERT_KINDOF函数的具体用法?C++ ASSERT_KINDOF怎么用?C++ ASSERT_KINDOF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ASSERT_KINDOF函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ASSERT_KINDOF// walk up two parents for MDIFrame that owns MDIChild (skip MDIClient)CMDIFrameWnd* CMDIChildWnd::GetMDIFrame(){ ASSERT_KINDOF(CMDIChildWnd, this); ASSERT(m_hWnd != NULL); HWND hWndMDIClient = ::GetParent(m_hWnd); ASSERT(hWndMDIClient != NULL); CMDIFrameWnd* pMDIFrame; pMDIFrame = (CMDIFrameWnd*)CWnd::FromHandle(::GetParent(hWndMDIClient)); ASSERT(pMDIFrame != NULL); ASSERT_KINDOF(CMDIFrameWnd, pMDIFrame); ASSERT(pMDIFrame->m_hWndMDIClient == hWndMDIClient); ASSERT_VALID(pMDIFrame); return pMDIFrame;}
开发者ID:VectorDM,项目名称:VC98,代码行数:16,
示例2: GetScrollPosvoid CLibraryMetaPanel::OnLButtonUp(UINT nFlags, CPoint point){ point.y += GetScrollPos( SB_VERT ); if ( m_nSelected > 0 && m_rcFolder.PtInRect( point ) ) { CQuickLock oLock( Library.m_pSection ); if ( CLibraryFolder* pFolder = LibraryFolders.GetFolder( m_sFolder ) ) { if ( Settings.Library.ShowVirtual ) { CLibraryFrame* pFrame = (CLibraryFrame*)GetOwner(); ASSERT_KINDOF(CLibraryFrame, pFrame ); pFrame->Display( pFolder ); } else if ( LibraryFolders.CheckFolder( pFolder, TRUE ) ) { ShellExecute( AfxGetMainWnd()->GetSafeHwnd(), NULL, m_sFolder, NULL, NULL, SW_SHOWNORMAL ); } } } else if ( m_nSelected > 0 && m_rcRating.PtInRect( point ) ) { CLibraryListPtr pList( GetViewSelection() ); if ( pList && pList->GetCount() > 0 ) { CFilePropertiesSheet dlg; dlg.Add( pList ); dlg.DoModal( 2 ); } } else if ( CMetaItem* pItem = m_pMetadata->HitTest( point, TRUE ) ) { CQuickLock oLock( Library.m_pSection ); if ( CAlbumFolder* pFolder = pItem->GetLinkTarget() ) { CLibraryFrame* pFrame = (CLibraryFrame*)GetOwner(); ASSERT_KINDOF(CLibraryFrame, pFrame ); pFrame->Display( pFolder ); } } CPanelCtrl::OnLButtonUp( nFlags, point );}
开发者ID:ivan386,项目名称:Shareaza,代码行数:48,
示例3: ASSERTBOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext){ ASSERT(pContext != NULL && pContext->m_pNewViewClass != NULL); if (!splitter_.CreateStatic(this, 1, 5)) { AfxMessageBox("Failed to create splitter."); return FALSE; } // We create with 5 columns then delete all except one, which means only one (for // hex view) is shown but 4 more can be added (template, aerial, preview and compare views). splitter_.DelColumn(4); splitter_.DelColumn(3); splitter_.DelColumn(2); splitter_.DelColumn(1); if (!splitter_.CreateView(0, 0, RUNTIME_CLASS(CHexTabView), CSize(0, 0), pContext)) { AfxMessageBox("Failed to create splitter view."); return FALSE; } ptv_ = (CHexTabView *)splitter_.GetPane(0, 0); ASSERT_KINDOF(CHexTabView, ptv_); return TRUE;}
开发者ID:Andrew-Phillips,项目名称:HexEdit,代码行数:27,
示例4: ASSERT_VALIDSTDMETHODIMP COleUILinkInfo::UpdateLink( DWORD dwLink, BOOL /*fErrorMessage*/, BOOL /*fErrorAction*/){ COleClientItem* pItem = (COleClientItem*)dwLink; ASSERT_VALID(pItem); ASSERT_KINDOF(COleClientItem, pItem); SCODE sc; TRY { // link not up-to-date, attempt to update it if (!pItem->UpdateLink()) AfxThrowOleException(pItem->GetLastStatus()); pItem->m_bLinkUnavail = FALSE; sc = S_OK; } CATCH_ALL(e) { pItem->m_bLinkUnavail = TRUE; sc = COleException::Process(e); pItem->ReportError(sc); DELETE_EXCEPTION(e); } END_CATCH_ALL return sc;}
开发者ID:rickerliang,项目名称:OpenNT,代码行数:27,
示例5: ASSERT_VALID//////////////////// Handle WM_NCACTIVATE for main window//BOOL CCaptionPainter::OnNcActivate(BOOL bActive){ ASSERT_VALID(m_pParentDlg); CDialog& dlg = *((CDialog*)m_pParentDlg); ASSERT_KINDOF(CDialog, &dlg);/* // Turn WS_VISIBLE off before calling DefWindowProc, // so DefWindowProc won't paint and thereby cause flicker. // DWORD dwStyle = dlg.GetStyle(); if (dwStyle & WS_VISIBLE) ::SetWindowLong(dlg, GWL_STYLE, (dwStyle & ~ WS_VISIBLE)); MSG& msg = AfxGetThreadState()->m_lastSentMsg; msg.wParam = bActive; Default(); if (dwStyle & WS_VISIBLE) ::SetWindowLong(frame, GWL_STYLE, dwStyle);*/ // At this point, nothing has happened (since WS_VISIBLE was off). // Now it's time to paint. // m_bActive = bActive; // update state dlg.SendMessage(WM_NCPAINT); // paint non-client area (frame too) return TRUE; // done OK}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:29,
示例6: ASSERT_KINDOFLRESULT COleIPFrameWnd::OnResizeChild(WPARAM, LPARAM lParam){ // notify the container that the rectangle has changed! COleServerDoc* pDoc = (COleServerDoc*)GetActiveDocument(); if (pDoc == NULL) return 0; ASSERT_KINDOF(COleServerDoc, pDoc); // get new rect and parent CRect rectNew; rectNew.CopyRect((LPCRECT)lParam); CWnd* pParentWnd = GetParent(); ASSERT_VALID(pParentWnd); // convert rectNew relative to pParentWnd ClientToScreen(&rectNew); pParentWnd->ScreenToClient(&rectNew); // adjust the new rectangle for the current control bars CWnd* pLeftOver = GetDlgItem(AFX_IDW_PANE_FIRST); ASSERT(pLeftOver != NULL); CRect rectCur = m_rectPos; pLeftOver->CalcWindowRect(&rectCur, CWnd::adjustOutside); rectNew.left += m_rectPos.left - rectCur.left; rectNew.top += m_rectPos.top - rectCur.top; rectNew.right -= rectCur.right - m_rectPos.right; rectNew.bottom -= rectCur.bottom - m_rectPos.bottom; OnRequestPositionChange(rectNew); return 0;}
开发者ID:rickerliang,项目名称:OpenNT,代码行数:32,
示例7: ASSERT_KINDOFBOOL CGlobalObj::bOpenFunctioneditorfile(CString omStrNewCFileName){ BOOL bFileFound = TRUE; CFunctionEditorDoc* pDoc = CFunctionEditorBase::pCreateNewDocument(m_eBus); // file-attribute information if (pDoc != nullptr) { CEditFrameWnd::sm_eBus = m_eBus; struct _tfinddata_t fileinfo; // Check if file exists if (_tfindfirst( omStrNewCFileName.GetBuffer(MAX_PATH), &fileinfo) == -1L) { bFileFound = pDoc->bCreateNewDocument(omStrNewCFileName); } if (bFileFound == TRUE) { //// Now open the selected file pDoc->OnOpenDocument(omStrNewCFileName); CMultiDocTemplate* pTemplate = m_pEditorDocTemplate; m_pEditFrameWnd = (CEditFrameWnd*)(pTemplate->CreateNewFrame(pDoc, nullptr)); //If null is passed as parameter the m_pdoc->GetNextView(pos) will // give null value if (m_pEditFrameWnd != nullptr) { ASSERT_KINDOF(CEditFrameWnd, m_pEditFrameWnd); pTemplate->InitialUpdateFrame(m_pEditFrameWnd, /*nullptr*/pDoc); } } } return bFileFound;}
开发者ID:Jason45degree,项目名称:busmaster,代码行数:33,
示例8: ASSERT_VALIDvoid CBasePropertySheet::AddPage(CPropertyPage* pPage){ ASSERT_VALID(this); ASSERT(pPage != NULL); ASSERT_KINDOF(CPropertyPage, pPage); ASSERT_VALID(pPage); // add page to internal list m_pages.Add(pPage); // add page externally if (m_hWnd != NULL) { // build new prop page array AFX_OLDPROPSHEETPAGE *ppsp = new AFX_OLDPROPSHEETPAGE[m_pages.GetSize()]; memcpy(ppsp, m_psh.ppsp, sizeof(AFX_OLDPROPSHEETPAGE) * (m_pages.GetSize()-1)); delete[] (PROPSHEETPAGE*)m_psh.ppsp; m_psh.ppsp = (PROPSHEETPAGE*)ppsp; ppsp += m_pages.GetSize()-1; // copy processed PROPSHEETPAGE struct to end memcpy(ppsp, &pPage->m_psp, sizeof(pPage->m_psp));// pPage->PreProcessPageTemplate((PROPSHEETPAGE&)*ppsp, IsWizard()); CPropertyPage_PreProcessPageTemplate((_CCPropertyPage*)pPage, (PROPSHEETPAGE&)*ppsp, IsWizard()); HPROPSHEETPAGE hPSP = CreatePropertySheetPage((PROPSHEETPAGE*)ppsp); if (hPSP == NULL) AfxThrowMemoryException(); if (!SendMessage(PSM_ADDPAGE, 0, (LPARAM)hPSP)) { DestroyPropertySheetPage(hPSP); AfxThrowMemoryException(); } }}
开发者ID:hackshields,项目名称:antivirus,代码行数:35,
示例9: OutputDebugStringCBenubirdAutoProxy::CBenubirdAutoProxy(){ g_strDBG.Empty(); g_strDBG.Format(_T("------------------------------------- start AutoProxy %X"),this); OutputDebugString(g_strDBG); EnableAutomation(); // To keep the application running as long as an automation // object is active, the constructor calls AfxOleLockApp. AfxOleLockApp(); // Get access to the dialog through the application's // main window pointer. Set the proxy's internal pointer // to point to the dialog, and set the dialog's back pointer to // this proxy. ASSERT_VALID(AfxGetApp()->m_pMainWnd); if (AfxGetApp()->m_pMainWnd) { ASSERT_KINDOF(CMainFrame, AfxGetApp()->m_pMainWnd); if (AfxGetApp()->m_pMainWnd->IsKindOf(RUNTIME_CLASS(CMainFrame))) { m_pDialog = reinterpret_cast<CMainFrame*>(AfxGetApp()->m_pMainWnd); m_pDialog->m_pAutoProxy = this; } }}
开发者ID:cspark777,项目名称:PDFManager,代码行数:28,
示例10: ASSERT_VALIDvoid CListViewWalkerPropertySheet::InsertPage(int iIndex, CPropertyPage* pPage){ ASSERT_VALID( this ); ASSERT( pPage != NULL ); ASSERT_KINDOF( CPropertyPage, pPage ); ASSERT_VALID( pPage ); m_pages.InsertAt(iIndex, pPage); BuildPropPageArray(); if (m_hWnd != NULL) { PROPSHEETPAGE* ppsp = const_cast<PROPSHEETPAGE*>(m_psh.ppsp); for (UINT i = 0; i < m_psh.nPages; i++) { if (i == (UINT)iIndex) break; (BYTE*&)ppsp += ppsp->dwSize; } HPROPSHEETPAGE hPSP = CreatePropertySheetPage(ppsp); if (hPSP == NULL) AfxThrowMemoryException(); if (!SendMessage(PSM_INSERTPAGE, iIndex, (LPARAM)hPSP)) { DestroyPropertySheetPage(hPSP); AfxThrowMemoryException(); } }}
开发者ID:acat,项目名称:emule,代码行数:29,
示例11: GetFirstViewPositionvoid CServerDoc::OnSetItemRects(LPCRECT lpPosRect, LPCRECT lpClipRect){ // get first view of document POSITION pos = GetFirstViewPosition(); ASSERT(pos != NULL); CServerView* pView = (CServerView*)GetNextView(pos); ASSERT_KINDOF(CServerView, pView); ASSERT_VALID(pView); CSize sizeNum(lpPosRect->right - lpPosRect->left, lpPosRect->bottom - lpPosRect->top); // for denom -- get extent in device // create a view dc CServerDC dc(pView); // set zoom to 100% dc.SetViewportExt(CSize(1,1)); dc.SetWindowExt(CSize(1,1)); // get extents in device CSize sizeDenom = pView->CalcActualItemSize(m_pRoot, &dc); // notify first view of potential zoom factor change! pView->SetZoomFactor(sizeNum, sizeDenom); // resize the window COleServerDoc::OnSetItemRects(lpPosRect, lpClipRect); // set scrollbar state (if necessary) pView->SetScrollInfo();}
开发者ID:Jinjiego,项目名称:VCSamples,代码行数:27,
示例12: ASSERT_KINDOF/////////////////////////////////////////////////////////////////////////////// CNewProjectEndPage message handlersBOOL CNewProjectEndPage::OnSetActive(){ CPropertySheet* pSheet = (CPropertySheet*)GetParent(); ASSERT_KINDOF(CPropertySheet, pSheet); pSheet->SetWizardButtons(PSWIZB_FINISH); return CPropertyPageEx::OnSetActive();}
开发者ID:malpharo,项目名称:AiPI,代码行数:9,
示例13: sizeofvoid CDrawObj::Serialize(CArchive& ar){ CObject::Serialize(ar); if (ar.IsStoring()) { ar << m_position; ar << (WORD)m_bPen; ar.Write(&m_logpen, sizeof(LOGPEN)); ar << (WORD)m_bBrush; ar.Write(&m_logbrush, sizeof(LOGBRUSH)); } else { // get the document back pointer from the archive m_pDocument = (CDrawDoc*)ar.m_pDocument; ASSERT_VALID(m_pDocument); ASSERT_KINDOF(CDrawDoc, m_pDocument); WORD wTemp; ar >> m_position; ar >> wTemp; m_bPen = (BOOL)wTemp; ar.Read(&m_logpen,sizeof(LOGPEN)); ar >> wTemp; m_bBrush = (BOOL)wTemp; ar.Read(&m_logbrush, sizeof(LOGBRUSH)); }}
开发者ID:zxlooong,项目名称:bcgexp,代码行数:26,
示例14: ASSERT_VALIDBOOL CBCGPDropDownToolBar::OnSendCommand(const CBCGPToolbarButton* pButton){ ASSERT_VALID (pButton); if ((pButton->m_nStyle & TBBS_DISABLED) != 0 || pButton->m_nID == 0 || pButton->m_nID == (UINT)-1) { return FALSE; } CBCGPDropDownFrame* pParent = (CBCGPDropDownFrame*)GetParent(); ASSERT_KINDOF(CBCGPDropDownFrame, pParent); pParent->m_pParentBtn->SetDefaultCommand (pButton->m_nID); //---------------------------------- // Send command to the parent frame: //---------------------------------- CFrameWnd* pParentFrame = GetParentFrame (); ASSERT_VALID (pParentFrame); GetOwner()->PostMessage(WM_COMMAND, pButton->m_nID); pParentFrame->DestroyWindow (); return TRUE;}
开发者ID:iclosure,项目名称:jframework,代码行数:25,
示例15: ASSERT_KINDOFBOOL CLicenseDlg::OnSetActive(){ if (!CheckWindowsVersion()) { CPropertyPage::EndDialog(IDCANCEL); } CPropertySheet* pSheet = (CPropertySheet*)GetParent(); ASSERT_KINDOF(CPropertySheet, pSheet); if (m_FirstTime) { m_FirstTime = FALSE; // Disable everything until the user scrolls the license text CButton *radio_all = (CButton *) GetDlgItem(IDC_DISAGREE); radio_all->SetCheck(1); CButton *understand = (CButton *) GetDlgItem(IDC_UNDERSTAND); understand->SetCheck(BST_UNCHECKED); OnUnderstand(); understand->EnableWindow(FALSE); pSheet->SetWizardButtons(0); UpdateData(FALSE); // write to screen } else { pSheet->SetWizardButtons(PSWIZB_NEXT); } return CPropertyPage::OnSetActive();}
开发者ID:AVGirl,项目名称:dynamorio,代码行数:25,
示例16: ASSERTLRESULT CDibView::OnDoRealize(WPARAM wParam, LPARAM){ ASSERT(wParam != NULL); CDibDoc* pDoc = GetDocument(); if (pDoc->GetHDIB() == NULL) return 0L; // must be a new document CPalette* pPal = pDoc->GetDocPalette(); if (pPal != NULL) { CMainFrame* pAppFrame = (CMainFrame*) AfxGetApp()->m_pMainWnd; ASSERT_KINDOF(CMainFrame, pAppFrame); CClientDC appDC(pAppFrame); // All views but one should be a background palette. // wParam contains a handle to the active view, so the SelectPalette // bForceBackground flag is FALSE only if wParam == m_hWnd (this view) CPalette* oldPalette = appDC.SelectPalette(pPal, ((HWND)wParam) != m_hWnd); if (oldPalette != NULL) { UINT nColorsChanged = appDC.RealizePalette(); if (nColorsChanged > 0) pDoc->UpdateAllViews(NULL); appDC.SelectPalette(oldPalette, TRUE); } else { TRACE0("/tSelectPalette failed in CDibView::OnPaletteChanged/n"); } } return 0L;}
开发者ID:dani102,项目名称:Tema-2,代码行数:34,
|