Click here to Skip to main content
15,913,685 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Syntax Error Pin
Member 1060570218-Mar-14 2:37
Member 1060570218-Mar-14 2:37 
GeneralRe: Syntax Error Pin
Albert Holguin18-Mar-14 5:03
professionalAlbert Holguin18-Mar-14 5:03 
QuestionAbout InstallWinIoDriver function of WinIo.dll Pin
cedricvictor17-Mar-14 3:38
cedricvictor17-Mar-14 3:38 
AnswerRe: About InstallWinIoDriver function of WinIo.dll Pin
Gisle Vanem17-Mar-14 3:46
Gisle Vanem17-Mar-14 3:46 
AnswerRe: About InstallWinIoDriver function of WinIo.dll Pin
Randor 17-Mar-14 9:31
professional Randor 17-Mar-14 9:31 
GeneralRe: About InstallWinIoDriver function of WinIo.dll Pin
cedricvictor18-Mar-14 2:30
cedricvictor18-Mar-14 2:30 
QuestionVisual c++ 6 freeware ? Pin
KrishnaRayalu_Talisetti16-Mar-14 21:07
KrishnaRayalu_Talisetti16-Mar-14 21:07 
AnswerRe: Visual c++ 6 freeware ? Pin
CPallini16-Mar-14 22:25
mveCPallini16-Mar-14 22:25 
GeneralRe: Visual c++ 6 freeware ? Pin
KrishnaRayalu_Talisetti16-Mar-14 23:45
KrishnaRayalu_Talisetti16-Mar-14 23:45 
GeneralRe: Visual c++ 6 freeware ? Pin
CPallini16-Mar-14 23:54
mveCPallini16-Mar-14 23:54 
AnswerRe: Visual c++ 6 freeware ? Pin
Jochen Arndt16-Mar-14 22:32
professionalJochen Arndt16-Mar-14 22:32 
GeneralRe: Visual c++ 6 freeware ? Pin
KrishnaRayalu_Talisetti16-Mar-14 23:48
KrishnaRayalu_Talisetti16-Mar-14 23:48 
GeneralRe: Visual c++ 6 freeware ? Pin
Jochen Arndt17-Mar-14 0:04
professionalJochen Arndt17-Mar-14 0:04 
GeneralRe: Visual c++ 6 freeware ? Pin
KrishnaRayalu_Talisetti17-Mar-14 0:46
KrishnaRayalu_Talisetti17-Mar-14 0:46 
AnswerRe: Visual c++ 6 freeware ? Pin
Albert Holguin17-Mar-14 12:37
professionalAlbert Holguin17-Mar-14 12:37 
QuestionMFC CreateCompatibleDC(), Drawtext() no display [Solved] Pin
econy16-Mar-14 16:23
econy16-Mar-14 16:23 
AnswerRe: MFC CreateCompatibleDC(), Drawtext() no display Pin
CPallini16-Mar-14 23:41
mveCPallini16-Mar-14 23:41 
GeneralRe: MFC CreateCompatibleDC(), Drawtext() no display Pin
econy17-Mar-14 3:01
econy17-Mar-14 3:01 
AnswerRe: MFC CreateCompatibleDC(), Drawtext() no display Pin
Chris Losinger17-Mar-14 3:33
professionalChris Losinger17-Mar-14 3:33 
GeneralRe: MFC CreateCompatibleDC(), Drawtext() no display Pin
econy17-Mar-14 4:09
econy17-Mar-14 4:09 
Thanks, now the test string appeared.
But, the client area is black, and show text string in while color only, no change.
Please refer to the code:
C++
void CDrawTextTstDlg::OnTimer(UINT_PTR nIDEvent)
{
CDC *pDC; 
CRect tRect;
CDC   MemDC; 

pDC = this->GetDC();	
GetClientRect(&tRect);
MemDC.CreateCompatibleDC(NULL); 
	
CBitmap bmp;
bmp.CreateCompatibleBitmap(&MemDC, tRect.Width(), tRect.Height());
CBitmap *oldBitmap = MemDC.SelectObject(&bmp);
MemDC.SetBkMode(TRANSPARENT);
	
if (gtest == 0 ){
        MemDC.SetTextColor(RGB(255,255,255));
	MemDC.DrawText(_T("My Test"),&tRect,DT_CENTER|DT_VCENTER|DT_SINGLELINE);
	MemDC.SetTextColor(RGB(255,0,0));
		       MemDC.DrawText(_T("TEST"),&tRect,DT_CENTER|DT_VCENTER|DT_SINGLELINE);
}
else  {
	MemDC.SetTextColor(RGB(255,255,255));
		MemDC.DrawText(_T("TEST"),&tRect,DT_CENTER|DT_VCENTER|DT_SINGLELINE);
MemDC.SetTextColor(RGB(0,150,0));
MemDC.DrawText(_T("My Test"),&tRect,DT_CENTER|DT_VCENTER|DT_SINGLELINE);

}
	
pDC->BitBlt(0, 0, tRect.Width(), tRect.Height(), &MemDC, 
         0, 0, SRCCOPY);
m_Seconds++;
m_TimerEcho.Format(_T("%d: Seconds have passed"), m_Seconds); 
gtest ^= 1;
	
MemDC.SelectObject(oldBitmap);
bmp.DeleteObject();
MemDC.DeleteDC();
ReleaseDC(pDC);

CDialog::OnTimer(nIDEvent);
}

GeneralRe: MFC CreateCompatibleDC(), Drawtext() no display Pin
Chris Losinger17-Mar-14 4:21
professionalChris Losinger17-Mar-14 4:21 
NewsRe: MFC CreateCompatibleDC(), Drawtext() no display Pin
econy17-Mar-14 4:30
econy17-Mar-14 4:30 
GeneralRe: MFC CreateCompatibleDC(), Drawtext() no display Pin
Chris Losinger17-Mar-14 5:02
professionalChris Losinger17-Mar-14 5:02 
GeneralRe: MFC CreateCompatibleDC(), Drawtext() no display Pin
econy17-Mar-14 5:06
econy17-Mar-14 5:06 
GeneralRe: MFC CreateCompatibleDC(), Drawtext() no display Pin
econy17-Mar-14 5:19
econy17-Mar-14 5:19 

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.