本文整理匯總了C++中EndDoc函數的典型用法代碼示例。如果您正苦於以下問題:C++ EndDoc函數的具體用法?C++ EndDoc怎麽用?C++ EndDoc使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EndDoc函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: PlPrtClose
/*+/csubr/TOC----------------------------------------------------------------
* PlPrtClose - close a print job for a Windows printer
*
* Purpose:
* Closes a print job for a Windows printer. "end page" and "end
* document" commands are sent to the printer.
*
* After closing the print job, this routine wraps up operations
* for the PL_CTX for the printout.
*
* Return Value:
* PL_OK, or
* PL_PRT_CANCEL if bAbort is 1 or if PlPrtStatusWindow has been
* called and the operator clicks Cancel, or
* other codes for other errors
*
* Notes:
* 1. If bAbort is 1 (or if pPlot->bPrintCancel is 1), then the printout
* is aborted, so that nothing is sent to the printer.
* 2. This routine automatically calls PlotWrapup.
*
* See Also:
* PlPrtOpenDefault, PlPrtOpenDialog, PlPrtStatusWindow
*
*-Date Author Revision
* -------- ------------ --------
* 06-08-95 R. Cole created
*--------------------------------------------------------------------------*/
int PASCAL
PlPrtClose(
PL_CTX *pPlot, // IO pointer to plot context struct for printing
int bAbort) // I 1 to abort the printout
{
int retStat=PL_OK;
int stat;
PRINTDLG *pPd=NULL;
if (pPlot->hDC != 0) {
if (bAbort || pPlot->bPrintCancel)
stat = AbortDoc(pPlot->hDC);
else {
stat = EndPage(pPlot->hDC);
stat = EndDoc(pPlot->hDC);
}
}
if (pPlot->pPd != NULL) {
pPd = (PRINTDLG *)pPlot->pPd;
if (pPd->hDevMode != 0) GlobalFree(pPd->hDevMode);
if (pPd->hDevNames != 0) GlobalFree(pPd->hDevNames);
GlobalUnlock(pPlot->hPD);
}
if (pPlot->hPD != 0) GlobalFree(pPlot->hPD);
if (pPlot->hDC != 0) DeleteDC(pPlot->hDC);
pPlot->hDC = 0;
pPlot->hPD = 0;
pPlot->pPd = NULL;
retStat = PlPlotWrapup(pPlot);
strcpy(pPlot->szPrintOpen, "cls");
return retStat;
}
示例2: EndPage
void CWinPrint::Destroy()
{
// End page
EndPage();
// End printing
EndDoc();
// Delete the print dc
if ( m_pd.hDC ) DeleteDC( m_pd.hDC );
ZeroMemory( &m_pd, sizeof( m_pd ) );
#if defined ( RULIB_USE_PRINTDLG )
if ( m_pdx.hDC ) DeleteDC( m_pdx.hDC );
ZeroMemory( &m_pdx, sizeof( m_pdx ) );
#endif
ZeroMemory( &m_psd, sizeof( m_psd ) );
ZeroMemory( &m_rect, sizeof( m_rect ) );
}
示例3: endPrint
void endPrint()
{
EndPage(pdfDC);
EndDoc(pdfDC);
DeleteDC(pdfDC);
}
示例4: Print
void Print(HWND hWnd)
{
PRINTDLG PrintDialog;
memset(&PrintDialog, 0, sizeof(PRINTDLG));
PrintDialog.lStructSize = sizeof(PRINTDLG);
PrintDialog.hwndOwner = hWnd;
PrintDialog.hDevMode = NULL;
PrintDialog.hDevNames = NULL;
PrintDialog.nCopies = 1;
PrintDialog.Flags = PD_RETURNDC;
PrintDialog.nMinPage = 1;
PrintDialog.nMaxPage = 0xFFFF;
PrintDlg(&PrintDialog);
DOCINFO docInfo;
docInfo.cbSize = sizeof(docInfo);
docInfo.lpszDocName = L"Printing";
docInfo.lpszOutput = 0;
docInfo.lpszDatatype = 0;
docInfo.fwType = 0;
StartDoc(PrintDialog.hDC, &docInfo);
RECT printRect;
GetClientRect(hWnd, &printRect);
StretchBlt(PrintDialog.hDC, 0, 0, scrhor*4, scrvert*4, hdc1, scrhor/3, scrvert/3, scrhor/3*2,scrvert/3*2, SRCCOPY);
EndDoc(PrintDialog.hDC);
}
示例5: main
main ()
{
PRINTDLG pd;
DOCINFO di;
char* szMessage;
memset (&pd, 0, sizeof(PRINTDLG));
memset (&di, 0, sizeof(DOCINFO));
di.cbSize = sizeof(DOCINFO);
di.lpszDocName = "Test";
pd.lStructSize = sizeof(PRINTDLG);
pd.Flags = PD_PAGENUMS | PD_RETURNDC;
pd.nFromPage = 1;
pd.nToPage = 1;
pd.nMinPage = 1;
pd.nMaxPage = 1;
szMessage = 0;
if (PrintDlg (&pd))
{
if (pd.hDC)
{
if (StartDoc (pd.hDC, &di) != SP_ERROR)
{
StartPage (pd.hDC);
TextOut (pd.hDC, 0, 0, "Hello, printer!", 15);
EndPage (pd.hDC);
EndDoc (pd.hDC);
szMessage = "Printed.";
}
else
{
szMessage = "Could not start document.";
}
}
else
{
szMessage = "Could not create device context.";
}
}
else
{
szMessage = "Canceled or printer could not be setup.";
}
if (szMessage)
{
MessageBox (NULL, szMessage, "Print Test", MB_OK);
}
return 0;
}
示例6: EndDoc
void Print::endprint(HWND ohwnd) { //put the hwnd here
EndDoc(printdlg.hDC);
DeleteDC(memDC);
DeleteDC(printer_mem_dc);
DeleteDC(printdlg.hDC);
ReleaseDC(ohwnd, hdc);
}
示例7: endDoc
void endDoc(int hdc)
{
//rMessageBox(NULL, MB_APPLMODAL, "in endDoc", "");
if (bUserAbort)
AbortDoc((HDC) hdc);
else
EndDoc((HDC) hdc);
}
示例8: EndPage
Fl_Gdi::~Fl_Gdi()
{
if(nPages)
EndPage(gc_);
EndDoc(gc_);
DeleteDC(gc_);
if(delete_mode_) GlobalFree(mode_);
}
示例9: private_delprinter
/*
* Internal printer deletion function.
*/
static void private_delprinter(printer obj)
{
HDC h = (HDC) obj->handle;
if (!obj || !h || (obj->kind != PrinterObject)) return;
EndPage(h);
EndDoc(h);
DeleteDC(h);
return;
}
示例10: GetProfileString
void CComPrint::PrintBmp(UINT nBmpId)
{
char szPrinter[200] = "";
char *pszDevice = NULL;
char *pszDriver = NULL;
char *pszOutput = NULL;
HDC hdcPrint = NULL; // 定義一個設備環境句柄
static DOCINFO di={sizeof(DOCINFO),"printer",NULL};
// 得到設備字符串存入數組szPrinter中
GetProfileString("windows","device",",,,",szPrinter,80);
// 將設備字符串分解
if( (NULL != (pszDevice = strtok(szPrinter,","))) &&
(NULL != (pszDriver = strtok(NULL,","))) &&
(NULL != (pszOutput = strtok(NULL,","))))
{
// 創建一個打印機設備句柄
if((hdcPrint = CreateDC(pszDriver,pszDevice, pszOutput, NULL)) != 0)
{
if (StartDoc(hdcPrint, &di) > 0) //開始執行一個打印作業
{
StartPage(hdcPrint); //打印機走紙,開始打印
SaveDC(hdcPrint); //保存打印機設備句柄
#pragma warning(disable:4312)
// 輸出圖片
HBITMAP hBitmap=::LoadBitmap(AfxGetInstanceHandle(),(LPCTSTR)nBmpId);
BITMAP bitmap;
::GetObject(hBitmap,sizeof(BITMAP),&bitmap);
#pragma warning(default:4312)
HDC dcMem;
dcMem=::CreateCompatibleDC(hdcPrint);
HBITMAP hOldBmp=(HBITMAP)::SelectObject(dcMem,hBitmap);
int nVertCenterPos = ::GetDeviceCaps(hdcPrint, VERTRES) / 2;
::StretchBlt(hdcPrint,1,50,400,bitmap.bmHeight,dcMem,0,0,bitmap.bmWidth,bitmap.bmHeight,SRCCOPY);
::SelectObject(dcMem,hOldBmp);
::DeleteDC(dcMem);
::DeleteObject(hBitmap);
RestoreDC(hdcPrint,-1); //恢複打印機設備句柄
EndPage(hdcPrint); //打印機停紙,停止打印
EndDoc(hdcPrint); //結束一個打印作業
}
// 用API函數DeleteDC銷毀一個打印機設備句柄
DeleteDC(hdcPrint);
}
}
}
示例11: AbortDoc
/* false=error, true=ok */
bool kGUIPrintJobMINGW::End(void)
{
if(m_error==true) /* some error occured previously, abort */
AbortDoc (m_printerHDC);
else
EndDoc (m_printerHDC);
return(!m_error);
}
示例12: finishDocument
int finishDocument(const int pdcID) {
HDC pdc = printerDCs[pdcID];
if (pdc != NULL) {
if (EndDoc(pdc) > 0) {
releasePrinterDC(pdcID);
return JNI_TRUE;
}
}
return JNI_FALSE;
}
示例13: gdi_abort
/*
* Clean up the GDI data structures without attempting any more printing.
*/
static void
gdi_abort(void)
{
if (pstate.out_row) {
(void) EndPage(pstate.dlg.hDC);
pstate.out_row = 0;
}
(void) EndDoc(pstate.dlg.hDC);
cleanup_fonts();
}
示例14: ASSERT
bool CPrinterDC::End(void)
{
ASSERT(m_hDC);
m_iLastError = EndDoc(m_hDC);
// Error occurred?
if (m_iLastError < 0)
return FALSE;
return TRUE;
}
示例15: cdkillcanvas
/*
%F cdKillCanvas para Printer.
Termina a pagina e termina o documento, enviando-o para a impressora.
*/
static void cdkillcanvas (cdCtxCanvas *ctxcanvas)
{
EndPage(ctxcanvas->hDC);
EndDoc(ctxcanvas->hDC);
cdwKillCanvas(ctxcanvas);
DeleteDC(ctxcanvas->hDC);
memset(ctxcanvas, 0, sizeof(cdCtxCanvas));
free(ctxcanvas);
}