當前位置: 首頁>>代碼示例>>C++>>正文


C++ ASSERT_KINDOF函數代碼示例

本文整理匯總了C++中ASSERT_KINDOF函數的典型用法代碼示例。如果您正苦於以下問題:C++ ASSERT_KINDOF函數的具體用法?C++ ASSERT_KINDOF怎麽用?C++ ASSERT_KINDOF使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了ASSERT_KINDOF函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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,代碼來源:WINMDI.CPP

示例2: GetScrollPos

void 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,代碼來源:CtrlLibraryMetaPanel.cpp

示例3: ASSERT

BOOL 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,代碼來源:ChildFrm.cpp

示例4: ASSERT_VALID

STDMETHODIMP 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,代碼來源:oledlgs1.cpp

示例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,代碼來源:PaintCap.cpp

示例6: ASSERT_KINDOF

LRESULT 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,代碼來源:oleipfrm.cpp

示例7: ASSERT_KINDOF

BOOL 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,代碼來源:GlobalObj.cpp

示例8: ASSERT_VALID

void 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,代碼來源:BasePropertySheet.cpp

示例9: OutputDebugString

CBenubirdAutoProxy::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,代碼來源:BenubirdAutoProxy.cpp

示例10: ASSERT_VALID

void 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,代碼來源:ListViewWalkerPropertySheet.cpp

示例11: GetFirstViewPosition

void 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,代碼來源:svrdoc.cpp

示例12: ASSERT_KINDOF

/////////////////////////////////////////////////////////////////////////////
// CNewProjectEndPage message handlers
BOOL CNewProjectEndPage::OnSetActive()
{
	CPropertySheet* pSheet = (CPropertySheet*)GetParent();
	ASSERT_KINDOF(CPropertySheet, pSheet);
	pSheet->SetWizardButtons(PSWIZB_FINISH);
	return CPropertyPageEx::OnSetActive();
}
開發者ID:malpharo,項目名稱:AiPI,代碼行數:9,代碼來源:NewProjectEndPage.cpp

示例13: sizeof

void 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,代碼來源:drawobj.cpp

示例14: ASSERT_VALID

BOOL 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,代碼來源:BCGPDropDown.cpp

示例15: ASSERT_KINDOF

BOOL 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,代碼來源:LicenseDlg.cpp


注:本文中的ASSERT_KINDOF函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。