当前位置: 首页>>代码示例>>C++>>正文


C++ PrintContext::SaveStartOfBand方法代码示例

本文整理汇总了C++中PrintContext::SaveStartOfBand方法的典型用法代码示例。如果您正苦于以下问题:C++ PrintContext::SaveStartOfBand方法的具体用法?C++ PrintContext::SaveStartOfBand怎么用?C++ PrintContext::SaveStartOfBand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PrintContext的用法示例。


在下文中一共展示了PrintContext::SaveStartOfBand方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GrindOutPrintJob

int CLabelView::GrindOutPrintJob(PrintContext& pc)
{
/*
// Print our document(s).
*/

	CLabelPrintDialog* pDialog = (CLabelPrintDialog*)pc.m_pPD;

	CPmwDoc* pDoc = GetDocument();

	pDialog->ComputeTotals();

/* Extract the name list. */

	CStdMacroServer* pMacroServer = pDoc->GetMacroServer();
	NameListRecord* pNameList = pMacroServer->GetNameList();

	BOOL fMergePrint = FALSE;

	int nNames = pNameList->Names();

	int nTotalPages = pDialog->m_nTotalPages;
	int nError = FALSE;

	BOOL fOldShow = pMacroServer->ShowMacroValues();

	StorageFile* pDatabaseFile = NULL;
	CFlatFileDatabase* pDatabase = NULL;
	CFlatFileDatabaseCursor* pCursor = NULL;

	if (GetConfiguration()->SupportsAddressBook(FALSE))
	{
		// get sender values for address book.	
		pMacroServer->BindSender();
	}

	if (!fOldShow)
	{
		pMacroServer->ShowMacroValues(TRUE);
		pDoc->ReflowMacros();
	}

	pc.m_pCursor = NULL;

	PPNT dims = pDoc->get_dimensions();
	pc.m_source.x0 = 0;
	pc.m_source.y0 = 0;
	pc.m_source.x1 = dims.x;
	pc.m_source.y1 = dims.y;

/*
// Set the printing conditions.
*/

	pc.m_nBoundName = -1;
	pc.m_nCurrentName = (nNames == 0) ? -1 : 0;
	pc.m_nCurrentCopy = 0;

	CString csFullName;
	TRY
	{
		csFullName = pDoc->GetPathManager()->LocatePath(pNameList->AddressBookName());
		TRACE("Open database %s for data!\r\n", (LPCSTR)csFullName);

		if (nNames != 0)
		{
			ERRORCODE Error = CAddressBook::OpenAddressBookDatabase(csFullName, pDatabaseFile, pDatabase, FALSE);
			if (Error != ERRORCODE_None)
			{
				ThrowErrorcodeException(Error);
			}

			// Create a cursor on the database.
			pCursor = new CFlatFileDatabaseCursor;
			pCursor->Attach(pDatabase);

			pc.m_pCursor = pCursor;
		}

		int nFromPage = pc.m_pInfo->GetFromPage();
		int nToPage = pc.m_pInfo->GetToPage();

		int nError = 0;
		pc.SaveStartOfBand();

		for (;;)
		{
			if (pc.m_fDoubleSided && (nFromPage != nToPage))
			{
				//
				// 1. Put up the dialog telling the user we are about to begin.
				//

				CPmwDialog BeginDialog(IDD_DOUBLE_SIDED_BEGIN);
				if (BeginDialog.DoModal() != IDOK)
				{
					nError = -1;
					break;
				}

//.........这里部分代码省略.........
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:101,代码来源:LBLVIEW.CPP


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