Click here to Skip to main content
15,915,869 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionWindows Media Player ActiveX Control. Pin
adityarao312-Jul-07 20:24
adityarao312-Jul-07 20:24 
Questionis it posible to do this.... Pin
Jhony george2-Jul-07 20:04
Jhony george2-Jul-07 20:04 
QuestionRe: is it posible to do this.... Pin
Hamid_RT2-Jul-07 22:15
Hamid_RT2-Jul-07 22:15 
QuestionRe: is it posible to do this.... Pin
Jhony george2-Jul-07 22:55
Jhony george2-Jul-07 22:55 
AnswerRe: is it posible to do this.... [modified] Pin
Mark Salsbery3-Jul-07 10:11
Mark Salsbery3-Jul-07 10:11 
GeneralRe: is it posible to do this.... Pin
Jhony george3-Jul-07 21:47
Jhony george3-Jul-07 21:47 
GeneralRe: is it posible to do this.... Pin
Mark Salsbery4-Jul-07 6:09
Mark Salsbery4-Jul-07 6:09 
QuestionA simple problem about DrawText Pin
whiteclouds2-Jul-07 17:09
whiteclouds2-Jul-07 17:09 
Hi all!
I've meet a problem about DrawText. I wrote some code like following:
	CString str[7];<br />
	CDC *pDC=this->GetDC();<br />
	<br />
	pDC->SetTextColor(RGB(255,0,0));<br />
	pDC->SetBkMode(TRANSPARENT);<br />
	CDC memdc;<br />
	CRect rc;<br />
	GetClientRect(&rc);<br />
	memdc.CreateCompatibleDC(pDC);<br />
	CBitmap bmp,*oldbmp;<br />
	bmp.CreateCompatibleBitmap(pDC,rc.Width(),rc.Height());<br />
	oldbmp=memdc.SelectObject(&bmp);<br />
	CPen mpen,*moldPen;<br />
	mpen.CreatePen(PS_SOLID,2,RGB(120,120,120));<br />
	moldPen=memdc.SelectObject(&mpen);<br />
	CFont mfnt,*moldfnt;<br />
	mfnt.CreateFontW(20,20,0,0,0,FALSE,FALSE,FALSE,GB2312_CHARSET,OUT_TT_ONLY_PRECIS,<br />
			CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FF_DONTCARE|DEFAULT_PITCH,_T("SYSTEM"));<br />
	moldfnt=memdc.SelectObject(&mfnt);<br />
	m_nGroupLeft=200;<br />
	m_nContTop=200;<br />
	rc.left=m_nGroupLeft+30;<br />
	rc.top=m_nContTop+20;//The problem occurs here<br />
	rc.right=m_nGroupLeft+200;<br />
	rc.bottom=m_nContTop+50;<br />
	ClientToScreen(&rc);<br />
//	memdc.BitBlt(rc.top,rc.left,rc.Width(),rc.Height(),pDC,rc.top,rc.left,SRCAND);<br />
	memdc.SetTextColor(RGB(255,0,0));<br />
	//memdc.SetBkColor(RGB(80,80,80));<br />
	memdc.SetBkMode(TRANSPARENT);<br />
	RECT rc_txt;<br />
	rc_txt.left=rc.left;//+10;<br />
	rc_txt.top=rc.top;<br />
	rc_txt.right=rc.right;// + 200;<br />
	rc_txt.bottom=rc.bottom;// + 50;<br />
	//ClientToScreen(&rc_txt);<br />
	memdc.DrawText(_T("Test\0"),-1,&rc,DT_LEFT|DT_SINGLELINE);<br />
	pDC->BitBlt(rc.top,rc.left,rc.Width(),rc.Height(),&memdc,rc.top,rc.left,SRCCOPY);//SRCPAINT,SRCAND<br />
	memdc.SelectObject(moldfnt);<br />
	mfnt.DeleteObject();<br />
	memdc.SelectObject(moldPen);<br />
	mpen.DeleteObject();<br />
	memdc.SelectObject(oldbmp);<br />
	bmp.DeleteObject();<br />
	memdc.DeleteDC();<br />

The thing I can't make clear is that the output of this code is only a half of 'Test'. When I assign the rc.top as m_nContTop + 10, the string is disappeared. I think the coordinates in the DrawText are the Text's position. But why the string will disappeared when I decrease the value of rc.top? And when the value increase, the string can appear? Thx!


Regard!

whiteclouds
AnswerRe: A simple problem about DrawText Pin
Arman S.2-Jul-07 19:27
Arman S.2-Jul-07 19:27 
Questionproblem about RichEdit Pin
kcynic2-Jul-07 15:29
kcynic2-Jul-07 15:29 
AnswerRe: problem about RichEdit Pin
Naveen2-Jul-07 15:42
Naveen2-Jul-07 15:42 
GeneralRe: problem about RichEdit Pin
kcynic2-Jul-07 18:41
kcynic2-Jul-07 18:41 
QuestionKeywords that I don't understand Pin
Alex Cutovoi2-Jul-07 13:26
Alex Cutovoi2-Jul-07 13:26 
AnswerRe: Keywords that I don't understand Pin
Stephen Hewitt2-Jul-07 13:30
Stephen Hewitt2-Jul-07 13:30 
AnswerRe: Keywords that I don't understand [modified] Pin
Jeremy Falcon2-Jul-07 14:12
professionalJeremy Falcon2-Jul-07 14:12 
GeneralRe: Keywords that I don't understand Pin
Stephen Hewitt2-Jul-07 15:03
Stephen Hewitt2-Jul-07 15:03 
GeneralRe: Keywords that I don't understand Pin
Jeremy Falcon2-Jul-07 15:16
professionalJeremy Falcon2-Jul-07 15:16 
GeneralRe: Keywords that I don't understand Pin
Stephen Hewitt2-Jul-07 15:38
Stephen Hewitt2-Jul-07 15:38 
GeneralRe: Keywords that I don't understand Pin
Jeremy Falcon2-Jul-07 16:00
professionalJeremy Falcon2-Jul-07 16:00 
GeneralRe: Keywords that I don't understand Pin
Stephen Hewitt2-Jul-07 16:15
Stephen Hewitt2-Jul-07 16:15 
GeneralRe: Keywords that I don't understand Pin
Jeremy Falcon2-Jul-07 16:24
professionalJeremy Falcon2-Jul-07 16:24 
GeneralRe: Keywords that I don't understand Pin
Jeremy Falcon2-Jul-07 16:08
professionalJeremy Falcon2-Jul-07 16:08 
GeneralRe: Keywords that I don't understand Pin
Stephen Hewitt2-Jul-07 16:22
Stephen Hewitt2-Jul-07 16:22 
GeneralRe: Keywords that I don't understand Pin
Jeremy Falcon2-Jul-07 16:25
professionalJeremy Falcon2-Jul-07 16:25 
GeneralRe: Keywords that I don't understand Pin
User 5838522-Jul-07 16:44
User 5838522-Jul-07 16:44 

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.