• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ASSERT_KINDOF函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ASSERT_KINDOF函数的典型用法代码示例。如果您正苦于以下问题:C++ ASSERT_KINDOF函数的具体用法?C++ ASSERT_KINDOF怎么用?C++ ASSERT_KINDOF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ASSERT_KINDOF函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: ASSERT

LRESULT 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,代码来源:dibview.cpp


示例17: ASSERT

UINT CThread::ThreadProc(LPVOID pObject)
{
	ASSERT(pObject);
	ASSERT_KINDOF(CThread, (CObject *)pObject);

	CThread *pThread = (CThread *)pObject;

	// initialisieren, ausführen, aufräumen
	if (pThread->InitInstance())
		pThread->Run();
	UINT nResult = pThread->ExitInstance();

	// den tatsächlich gelieferten Exit-Code setzen
	pThread->SetExitCode(nResult);

	pThread->m_pWinThread = NULL; // zerstört sich selbst
	HANDLE hThreadStoppedEvent = pThread->m_hThreadStoppedEvent;

	// Thread-Objekt ggf. automatisch zerstören
	if (pThread->m_bAutoDelete) delete pThread;

	// Beendigungs-Event setzen; setzt alle Threads fort, die in Join() warten
	VERIFY(SetEvent(hThreadStoppedEvent));

	return nResult;
}
开发者ID:IcyX,项目名称:bote,代码行数:26,代码来源:Thread.cpp


示例18: dc

void CImageView::OnLButtonDown(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	//SetCapture();viewfeatures==true
	CImageDoc*pDoc=GetDocument();
	CString rid,rs,rnc;
	if(pDoc->m_HC.GetSetSize())
	{
		CClientDC dc(this);
 		OnPrepareDC(&dc);
 		dc.DPtoLP(&point);
		int miss=pDoc->lookregion(point.x,point.y,1);
//		pDoc->curRegion=miss;
		rid.Format("ID:%d",miss);
	//	rs.Format("%d",pDoc->m_HC.S[miss].size);
	//	rnc.Format("%d",pDoc->m_HC.S[miss].perim);
	}
	CMainFrame* pMainFrame= (CMainFrame*)( AfxGetApp()->m_pMainWnd);
	ASSERT_KINDOF(CMainFrame, pMainFrame);
    pMainFrame->m_wndStatusBar.SetPaneText(PANE_REGION_ID, rid);
//	pMainFrame->m_wndStatusBar.SetPaneText(PANE_REGION_SIZE, rs);
//	pMainFrame->m_wndStatusBar.SetPaneText(PANE_RN_COUNT, rnc);
 	CScrollView::OnLButtonDown(nFlags, point);
	Invalidate();
}
开发者ID:caomw,项目名称:ImageSegmentor,代码行数:25,代码来源:imageView.cpp


示例19: ASSERT_KINDOF

/////////////////////////////////////////////////////////////////////////////
// CSettingsDialog::CreateWnd(CWnd *pWnd, CCreateContext *pContext /* = NULL */)
// Description:	Create generic CWnd based Window of a page
// Return value: TRUE if successful, NULL if failed
//
BOOL CSettingsDialog::CreateWnd(CWnd *pWnd, CCreateContext *pContext /* = NULL */)
{
	CCreateContext context;	
	if (pContext == NULL)	
	{
		// If no context specified, generate one from the currently selected
		//  client if possible
		context.m_pCurrentFrame = (CFrameWnd*) this;
		context.m_pCurrentDoc = NULL;
		context.m_pNewViewClass = NULL;
		pContext = &context;

	}
	
    ASSERT_KINDOF(CWnd, pWnd);
	ASSERT(pWnd->m_hWnd == NULL);       // Not yet created
	
	DWORD dwStyle = AFX_WS_DEFAULT_VIEW;
	CRect rect;
	// Create with the right size and position
	if (!pWnd->Create(NULL, NULL, dwStyle, rect, this, 0, pContext))
	{
		TRACE0("Warning: couldn't create wnd in CSettingsDialog.\n");
		// pWnd will be cleaned up by PostNcDestroy
		return FALSE;
	}
	return(TRUE);
}
开发者ID:segafan,项目名称:Construct-classic,代码行数:33,代码来源:SettingsDlg.cpp


示例20: _AfxAppendFilterSuffix

void AFXAPI _AfxAppendFilterSuffix(CString& filter, OPENFILENAME& ofn,
	CDocTemplate* pTemplate, CString* pstrDefaultExt)
{
	ASSERT_VALID(pTemplate);
	ASSERT_KINDOF(CDocTemplate, pTemplate);

	CString strFilterExt, strFilterName;
	if (pTemplate->GetDocString(strFilterExt, CDocTemplate::filterExt) &&
	 !strFilterExt.IsEmpty() &&
	 pTemplate->GetDocString(strFilterName, CDocTemplate::filterName) &&
	 !strFilterName.IsEmpty())
	{
		// a file based document template - add to filter list
		ASSERT(strFilterExt[0] == '.');
		if (pstrDefaultExt != NULL)
		{
			// set the default extension
			*pstrDefaultExt = ((LPCTSTR)strFilterExt) + 1;  // skip the '.'
			ofn.lpstrDefExt = (LPTSTR)(LPCTSTR)(*pstrDefaultExt);
			ofn.nFilterIndex = ofn.nMaxCustFilter + 1;  // 1 based number
		}

		// add to filter
		filter += strFilterName;
		ASSERT(!filter.IsEmpty());  // must have a file type name
		filter += (TCHAR)'\0';  // next string please
		filter += (TCHAR)'*';
		filter += strFilterExt;
		filter += (TCHAR)'\0';  // next string please
		ofn.nMaxCustFilter++;
	}
}
开发者ID:open2cerp,项目名称:Open2C-ERP,代码行数:32,代码来源:ReportManager.cpp



注:本文中的ASSERT_KINDOF函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ASSERT_LOG函数代码示例发布时间:2022-05-30
下一篇:
C++ ASSERT_INVALID_PCI_ADDRESS函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap