U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » RichText,QTF,RTF... » Name of a print job is missing
Re: Name of a print job is missing [message #6460 is a reply to message #6453] Mon, 13 November 2006 11:02 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
OK, first quick fix:

bool PrinterJob::Execute0(bool dodlg)
{
	pdlg = new Win32PrintDlg_;
	PRINTDLG& dlg = *pdlg;
	dlg.Flags = PD_DISABLEPRINTTOFILE|PD_NOSELECTION|PD_RETURNDC|PD_HIDEPRINTTOFILE;
	dlg.nFromPage = current;
	dlg.nToPage = current;
	dlg.nMinPage = from;
	dlg.nMaxPage = to;
	if(from != to)
		dlg.Flags |= PD_ALLPAGES;
	dlg.hwndOwner = GetActiveWindow();
	dlg.Flags |= PD_RETURNDEFAULT;
	if(!PrintDlg(&dlg)) return false;
	if(dlg.hDevMode) {
		DEVMODE *pDevMode = (DEVMODE*)::GlobalLock(dlg.hDevMode);
		pDevMode->dmOrientation = landscape ? DMORIENT_LANDSCAPE : DMORIENT_PORTRAIT;
		::GlobalUnlock(dlg.hDevMode);
	}
	bool b = true;
	if(dodlg) {
		DeleteDC(dlg.hDC);
		dlg.Flags &= ~PD_RETURNDEFAULT;
		b = PrintDlg(&dlg);
	}
	if(b) {
		draw = new PrintDraw(dlg.hDC, Nvl(name, Ctrl::GetAppName()));
		page.Clear();
		if(!(dlg.Flags & PD_PAGENUMS)) {
			dlg.nFromPage = dlg.nMinPage;
			dlg.nToPage = dlg.nMaxPage;
		}
		for(int c = 0; c < ((dlg.Flags & PD_COLLATE) ? dlg.nCopies : 1); c++)
			for(int i = dlg.nFromPage - 1; i <= dlg.nToPage - 1; i++)
				for(int c = 0; c < ((dlg.Flags & PD_COLLATE) ? 1 : dlg.nCopies); c++)
					page.Add(i);
		return true;
	}
	return false;
}


Unfortunately, this still does not solve the problem with landscape mode. Looks like calling CreateDC directly is the only option to achieve required operation...

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: report / qtf to pdf saving
Next Topic: Horizontal scrollbar
Goto Forum:
  


Current Time: Sun Jul 05 01:31:32 GMT+2 2026

Total time taken to generate the page: 0.00528 seconds