Click here to Skip to main content
16,005,038 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Exception "The parameter is incorrect." on CArchive Pin
Ed K4-Oct-04 15:49
Ed K4-Oct-04 15:49 
GeneralOwner Draw List Box Scrolling Problem - ?XP bug Pin
Michael Gunlock9-Sep-04 11:05
Michael Gunlock9-Sep-04 11:05 
GeneralSorting Recordset Pin
Ouenstreet9-Sep-04 10:49
Ouenstreet9-Sep-04 10:49 
GeneralRe: Sorting Recordset Pin
David Crow9-Sep-04 10:57
David Crow9-Sep-04 10:57 
GeneralRe: Sorting Recordset Pin
Ouenstreet10-Sep-04 4:05
Ouenstreet10-Sep-04 4:05 
GeneralRe: Sorting Recordset Pin
Ouenstreet10-Sep-04 10:55
Ouenstreet10-Sep-04 10:55 
GeneralRe: Sorting Recordset Pin
Ouenstreet13-Sep-04 9:56
Ouenstreet13-Sep-04 9:56 
GeneralHelp with Printing Pin
Eversman9-Sep-04 10:01
Eversman9-Sep-04 10:01 
Hey all,

I need a little help with printing. I have it all ready to print and it print fines, but I coded it stupidly. I hard coded the coordinates of where the text is printed, so it only prints correctly on certain printers, on others it prints all messed up. So now I am trying to change it so that it works right with all printers. This is what I have done so far.

<br />
<br />
CPrintDialog dlg(FALSE);     <br />
	CDC dc; <br />
	#if 0     <br />
	if (dlg.DoModal() == IDCANCEL)       <br />
		return;   <br />
	dc.Attach(dlg.GetPrinterDC());<br />
	#else     <br />
	PRINTDLG prtDlg;    <br />
	AfxGetApp()->GetPrinterDeviceDefaults(&prtDlg);     <br />
	dlg.m_pd.hDevMode = prtDlg.hDevMode;    <br />
	dlg.m_pd.hDevNames = prtDlg.hDevNames;    <br />
	dc.Attach(dlg.CreatePrinterDC());<br />
	#endif   <br />
	dc.m_bPrinting = TRUE;   <br />
<br />
<br />
	CRect printArea;<br />
printArea.SetRect(printArea.left/2, printArea.top/2, dc.GetDeviceCaps(HORZRES), dc.GetDeviceCaps(VERTRES));<br />
<br />
CString str("Delayed Entry");<br />
dc.DrawText(str, printArea, DT_NOPREFIX | DT_WORDBREAK);<br />
<br />


When I try that out it compiles fine, but when I print it it doesn't work, can anyone help me out here?

Thanks
GeneralRe: Help with Printing Pin
David Crow9-Sep-04 10:38
David Crow9-Sep-04 10:38 
GeneralRe: Help with Printing Pin
Eversman9-Sep-04 10:43
Eversman9-Sep-04 10:43 
GeneralRe: Help with Printing Pin
David Crow9-Sep-04 11:00
David Crow9-Sep-04 11:00 
GeneralRe: Help with Printing Pin
Eversman9-Sep-04 11:26
Eversman9-Sep-04 11:26 
GeneralRe: Help with Printing Pin
David Crow10-Sep-04 2:11
David Crow10-Sep-04 2:11 
GeneralWin32 control compositing Pin
Jim Crafton9-Sep-04 9:47
Jim Crafton9-Sep-04 9:47 
GeneralRe: Win32 control compositing Pin
Ryan Binns9-Sep-04 18:46
Ryan Binns9-Sep-04 18:46 
GeneralRe: Win32 control compositing Pin
Jim Crafton10-Sep-04 5:25
Jim Crafton10-Sep-04 5:25 
GeneralRe: Win32 control compositing Pin
Ryan Binns10-Sep-04 22:29
Ryan Binns10-Sep-04 22:29 
GeneralRe: Win32 control compositing Pin
Blake Miller13-Sep-04 6:32
Blake Miller13-Sep-04 6:32 
GeneralRe: Win32 control compositing Pin
Ryan Binns13-Sep-04 20:42
Ryan Binns13-Sep-04 20:42 
GeneralList Control : Can't change focus w/ tab key Pin
Wes Jones9-Sep-04 7:37
Wes Jones9-Sep-04 7:37 
GeneralRe: List Control : Can't change focus w/ tab key Pin
David Crow9-Sep-04 11:02
David Crow9-Sep-04 11:02 
GeneralRe: List Control : Can't change focus w/ tab key Pin
Wes Jones9-Sep-04 12:55
Wes Jones9-Sep-04 12:55 
Generalctabctrl Pin
prateekkathuria9-Sep-04 7:29
prateekkathuria9-Sep-04 7:29 
GeneralRe: ctabctrl Pin
prateekkathuria9-Sep-04 9:50
prateekkathuria9-Sep-04 9:50 
QuestionDisplaying a monochrome uchar array - formatting problem? Pin
towd9-Sep-04 5:23
towd9-Sep-04 5:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.