Click here to Skip to main content
15,891,184 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: type safe issue Pin
George_George12-Feb-08 1:20
George_George12-Feb-08 1:20 
GeneralRe: type safe issue Pin
Matthew Faithfull12-Feb-08 2:18
Matthew Faithfull12-Feb-08 2:18 
GeneralRe: type safe issue Pin
George_George12-Feb-08 2:23
George_George12-Feb-08 2:23 
QuestionHow to make a control transparent in a dialog Pin
swarup10-Feb-08 22:03
swarup10-Feb-08 22:03 
AnswerRe: How to make a control transparent in a dialog Pin
Hamid_RT10-Feb-08 22:13
Hamid_RT10-Feb-08 22:13 
GeneralText Draw problem with Print Preview Pin
Anik3310-Feb-08 21:33
Anik3310-Feb-08 21:33 
GeneralRe: Text Draw problem with Print Preview Pin
Hamid_RT10-Feb-08 22:05
Hamid_RT10-Feb-08 22:05 
GeneralRe: Text Draw problem with Print Preview Pin
Anik3310-Feb-08 23:04
Anik3310-Feb-08 23:04 
Not Solved Yet. Just Create an SDI Application and insert the following codes in OnDraw()
<br />
        CRect rcPos = CRect(10,10,500,40);<br />
	CFont font; LOGFONT lf;<br />
	ZeroMemory(&lf,sizeof(lf));<br />
	lf.lfHeight = 25;       lstrcpy(lf.lfFaceName,"Arial");<br />
	lf.lfWeight = FW_BOLD;	lf.lfCharSet = DEFAULT_CHARSET;<br />
	font.CreateFontIndirect(&lf);<br />
	pDC->SelectObject(&font);<br />
	CString str = "Sample Text1 Sample Text1 Sample Text1";	<br />
	pDC->DrawText(str, &rcPos, DT_LEFT|DT_VCENTER|DT_SINGLELINE);<br />
	font.DeleteObject();<br />
	rcPos.top	 += 30;<br />
	rcPos.bottom += 30;<br />
	<br />
	lf.lfHeight = 30;		 lstrcpy(lf.lfFaceName,"Comic Sans MS");<br />
	font.CreateFontIndirect(&lf);<br />
	pDC->SelectObject(&font);<br />
	str = "Sample Text2 Sample Text2";<br />
	pDC->DrawText(str, &rcPos, DT_LEFT|DT_VCENTER|DT_SINGLELINE);<br />
	font.DeleteObject();<br />


and insert following code to OnPrepareDC()
<br />
    pDC->SetMapMode(MM_ANISOTROPIC);<br />
CSize sizeDoc = CSize(1000,1000);<br />
pDC->SetWindowExt(sizeDoc);<br />
CDC dcScreen;<br />
dcScreen.CreateCompatibleDC(0);<br />
int nLogPixelX = dcScreen.GetDeviceCaps(LOGPIXELSX);<br />
int nLogPixelY = dcScreen.GetDeviceCaps(LOGPIXELSY);<br />
int nDevPixelX = pDC->GetDeviceCaps(LOGPIXELSX);<br />
int nDevPixelY = pDC->GetDeviceCaps(LOGPIXELSY);<br />
if (nLogPixelX != nDevPixelX || nLogPixelY != nDevPixelY)<br />
{<br />
    sizeDoc.cx = (sizeDoc.cx * nDevPixelX) / nLogPixelX;<br />
    sizeDoc.cy = (sizeDoc.cy * nDevPixelY) / nLogPixelY;<br />
}<br />
pDC->SetViewportExt(sizeDoc);<br />

Now run the exe. and see print preview.
GeneralRe: Text Draw problem with Print Preview Pin
Roger Allen15-Feb-08 1:10
Roger Allen15-Feb-08 1:10 
GeneralDynamically define arrays Pin
CodingLover10-Feb-08 21:29
CodingLover10-Feb-08 21:29 
GeneralRe: Dynamically define arrays Pin
Cedric Moonen10-Feb-08 21:35
Cedric Moonen10-Feb-08 21:35 
GeneralRe: Dynamically define arrays Pin
CodingLover10-Feb-08 21:57
CodingLover10-Feb-08 21:57 
GeneralRe: Dynamically define arrays Pin
Rajkumar R11-Feb-08 0:31
Rajkumar R11-Feb-08 0:31 
Generalconvert byte array to long Pin
jov10-Feb-08 21:03
jov10-Feb-08 21:03 
GeneralRe: convert byte array to long [modified] Pin
Cedric Moonen10-Feb-08 21:37
Cedric Moonen10-Feb-08 21:37 
QuestionRe: convert byte array to long Pin
CPallini10-Feb-08 22:17
mveCPallini10-Feb-08 22:17 
GeneralRe: convert byte array to long Pin
Cedric Moonen10-Feb-08 22:36
Cedric Moonen10-Feb-08 22:36 
Generalextern sample in MSDN Pin
George_George10-Feb-08 19:43
George_George10-Feb-08 19:43 
GeneralRe: extern sample in MSDN Pin
Don Box10-Feb-08 19:45
Don Box10-Feb-08 19:45 
GeneralRe: extern sample in MSDN Pin
George_George10-Feb-08 20:04
George_George10-Feb-08 20:04 
GeneralRe: extern sample in MSDN Pin
Stephen Hewitt10-Feb-08 20:26
Stephen Hewitt10-Feb-08 20:26 
GeneralRe: extern sample in MSDN Pin
George_George10-Feb-08 20:29
George_George10-Feb-08 20:29 
GeneralRe: extern sample in MSDN Pin
Stephen Hewitt10-Feb-08 20:44
Stephen Hewitt10-Feb-08 20:44 
GeneralRe: extern sample in MSDN Pin
George_George10-Feb-08 22:27
George_George10-Feb-08 22:27 
GeneralRe: extern sample in MSDN Pin
Stephen Hewitt11-Feb-08 14:15
Stephen Hewitt11-Feb-08 14:15 

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.