Click here to Skip to main content
15,921,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Memory Hogger!? Pin
Hamid_RT26-Sep-06 6:31
Hamid_RT26-Sep-06 6:31 
QuestionCEdit and ON_EN_CHANGE [modified] Pin
Oliver12324-Sep-06 6:55
Oliver12324-Sep-06 6:55 
AnswerRe: CEdit and ON_EN_CHANGE Pin
Eytukan24-Sep-06 7:20
Eytukan24-Sep-06 7:20 
GeneralRe: CEdit and ON_EN_CHANGE Pin
toxcct25-Sep-06 23:01
toxcct25-Sep-06 23:01 
AnswerRe: CEdit and ON_EN_CHANGE Pin
Gary R. Wheeler24-Sep-06 11:07
Gary R. Wheeler24-Sep-06 11:07 
QuestionRegistry Question Pin
LiYS24-Sep-06 5:54
LiYS24-Sep-06 5:54 
AnswerRe: Registry Question Pin
PJ Arends24-Sep-06 9:43
professionalPJ Arends24-Sep-06 9:43 
QuestionRich Edit Printing Pin
LiYS24-Sep-06 5:43
LiYS24-Sep-06 5:43 
Hi all:

The following is the code snippet for print the Rich Edit control, but they to no avail. MSDN says EM_FORMATRANGE EM_DISPLAYBAND should be used, but they don't seem to work, I run out of idea.

<br />
   PRINTDLG printDlg;<br />
   ZeroMemory(&printDlg, sizeof(printDlg));<br />
   printDlg.lStructSize = sizeof(printDlg);<br />
   printDlg.Flags = PD_RETURNDC;<br />
   <br />
   // Display a print dialog box.<br />
   if(!PrintDlg(&printDlg))<br />
   {<br />
      printf("Failure\n");<br />
   }<br />
   else<br />
   {<br />
	   long lLineWidth = ::MulDiv(GetDeviceCaps(PHYSICALWIDTH),1440, GetDeviceCaps(LOGPIXELSX));<br />
		FORMATRANGE fmtRange;<br />
		RECT rect;<br />
		RECT page;<br />
		int last = 0;<br />
<br />
		// get the page size in twips (1440 twips/inch)<br />
		page.left = 0;<br />
		page.top = 0;<br />
		page.right = ::MulDiv(GetDeviceCaps(PHYSICALWIDTH), 1440, GetDeviceCaps(LOGPIXELSX));<br />
		page.bottom = ::MulDiv(GetDeviceCaps(PHYSICALHEIGHT),1440, GetDeviceCaps(LOGPIXELSY));<br />
		// for our example, the rect is the page<br />
		rect = page;<br />
<br />
		// setup the format range attributes<br />
		fmtRange.hdc = MyDC.m_hDC;<br />
		fmtRange.hdcTarget = MyDC.m_hAttribDC;<br />
		fmtRange.rc = rect;<br />
		fmtRange.rcPage = page;<br />
<br />
		::SendMessage( m_REControl50W.m_hRE, EM_FORMATRANGE, TRUE, (LPARAM)&fmtRange);  <br />
		::SendMessage( m_REControl50W.m_hRE, EM_SETTARGETDEVICE, (WPARAM)printDlg.hDC, lLineWidth);  <br />
		::SendMessage( m_REControl50W.m_hRE, EM_DISPLAYBAND, (WPARAM) NULL, (LPARAM)&rect);  <br />
<br />





QuestionHow to open Dialog for choose folder Pin
Max++24-Sep-06 5:40
Max++24-Sep-06 5:40 
AnswerRe: How to open Dialog for choose folder Pin
eusto24-Sep-06 6:18
eusto24-Sep-06 6:18 
AnswerRe: How to open Dialog for choose folder Pin
tanvon malik24-Sep-06 6:22
tanvon malik24-Sep-06 6:22 
AnswerRe: How to open Dialog for choose folder Pin
tanvon malik24-Sep-06 6:36
tanvon malik24-Sep-06 6:36 
AnswerRe: How to open Dialog for choose folder Pin
Hamid_RT26-Sep-06 6:31
Hamid_RT26-Sep-06 6:31 
QuestionADO Recordsets and VC++ Pin
eusto24-Sep-06 5:08
eusto24-Sep-06 5:08 
QuestionFile input/output help Pin
eric_tran24-Sep-06 2:50
eric_tran24-Sep-06 2:50 
AnswerRe: File input/output help Pin
Eytukan24-Sep-06 3:16
Eytukan24-Sep-06 3:16 
AnswerRe: File input/output help Pin
singersinger24-Sep-06 3:22
singersinger24-Sep-06 3:22 
AnswerRe: File input/output help Pin
eric_tran24-Sep-06 4:20
eric_tran24-Sep-06 4:20 
GeneralRe: File input/output help Pin
eusto24-Sep-06 5:17
eusto24-Sep-06 5:17 
GeneralRe: File input/output help Pin
eric_tran24-Sep-06 5:26
eric_tran24-Sep-06 5:26 
GeneralRe: File input/output help Pin
eusto24-Sep-06 6:06
eusto24-Sep-06 6:06 
QuestionAccess violation problem Pin
singersinger24-Sep-06 2:44
singersinger24-Sep-06 2:44 
QuestionRe: Access violation problem Pin
Eytukan24-Sep-06 3:34
Eytukan24-Sep-06 3:34 
AnswerRe: Access violation problem Pin
Eytukan24-Sep-06 3:41
Eytukan24-Sep-06 3:41 
AnswerRe: Access violation problem Pin
Jörgen Sigvardsson24-Sep-06 14:32
Jörgen Sigvardsson24-Sep-06 14:32 

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.