Click here to Skip to main content
15,899,754 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Transparent edit box Pin
Hamid_RT16-Sep-06 1:39
Hamid_RT16-Sep-06 1:39 
GeneralRe: Transparent edit box Pin
fx920016-Sep-06 1:51
fx920016-Sep-06 1:51 
AnswerRe: Transparent edit box Pin
Hamid_RT16-Sep-06 1:28
Hamid_RT16-Sep-06 1:28 
GeneralRe: Transparent edit box Pin
fx920016-Sep-06 1:38
fx920016-Sep-06 1:38 
QuestionTime Delay !!!! New To C++ Pin
Mark_Murphy16-Sep-06 1:04
Mark_Murphy16-Sep-06 1:04 
AnswerRe: Time Delay !!!! New To C++ Pin
_AnsHUMAN_ 16-Sep-06 1:18
_AnsHUMAN_ 16-Sep-06 1:18 
GeneralRe: Time Delay !!!! New To C++ Pin
Mark_Murphy16-Sep-06 1:31
Mark_Murphy16-Sep-06 1:31 
QuestionHow to avoid view flashing when resizing window? Pin
jipai16-Sep-06 0:53
jipai16-Sep-06 0:53 
Hi there,
I created a dummy MFC app in VS2005. All I want to do is to paint the view black color. When I resize the window, the view is flashing white color all over. I thought painting to an off-screen DC then calling BitBlt could avoid that. Confused | :confused: Can someone please tell me how? Thanks a lot!

This is my OnDraw function.

void CtestView::OnDraw(CDC* pDC)
{
	CtestDoc* pDoc = GetDocument();
	if (!pDoc)
		return;

	CDC offScreenDC;
	CBitmap offScreenBitmap;
	CBitmap * pOldBitmap = NULL;
	CRect clientRect;
	GetClientRect(clientRect);

	// draw to offscreen bitmap for fast looking repaints
	if (offScreenDC.CreateCompatibleDC(pDC))
	{
		if (offScreenBitmap.CreateCompatibleBitmap(
				pDC,
				clientRect.Width(),
				clientRect.Height()
				)
			)
		{
			pOldBitmap = offScreenDC.SelectObject(&offScreenBitmap);
		}
	}

	// paint background
	CBrush brush;
	CBrush *pOldBrush = NULL;
	if (!brush.CreateSolidBrush(RGB(0, 0, 0)))
		return;
	pOldBrush = offScreenDC.SelectObject(&brush);
	offScreenDC.FillRect(clientRect, &brush);

	pDC->BitBlt(
		clientRect.left,
		clientRect.top,
		clientRect.Width(),
		clientRect.Height(),
		&offScreenDC,
		0,
		0,
		SRCCOPY
		);

	// restore
	offScreenDC.SelectObject(pOldBrush);
	offScreenDC.SelectObject(pOldBitmap);
}

AnswerRe: How to avoid view flashing when resizing window? Pin
prasad_som16-Sep-06 1:04
prasad_som16-Sep-06 1:04 
GeneralRe: How to avoid view flashing when resizing window? Pin
jipai17-Sep-06 15:15
jipai17-Sep-06 15:15 
GeneralRe: How to avoid view flashing when resizing window? Pin
jipai18-Sep-06 6:28
jipai18-Sep-06 6:28 
GeneralRe: How to avoid view flashing when resizing window? Pin
prasad_som18-Sep-06 19:51
prasad_som18-Sep-06 19:51 
QuestionHow to access a function in another class file Pin
vc++_fragrance15-Sep-06 23:10
vc++_fragrance15-Sep-06 23:10 
AnswerRe: How to access a function in another class file Pin
prasad_som15-Sep-06 23:48
prasad_som15-Sep-06 23:48 
GeneralRe: How to access a function in another class file Pin
vc++_fragrance17-Sep-06 19:55
vc++_fragrance17-Sep-06 19:55 
QuestionRe: How to access a function in another class file Pin
prasad_som17-Sep-06 20:36
prasad_som17-Sep-06 20:36 
AnswerRe: How to access a function in another class file Pin
ThatsAlok16-Sep-06 0:12
ThatsAlok16-Sep-06 0:12 
AnswerRe: How to access a function in another class file Pin
vc++_fragrance16-Sep-06 0:47
vc++_fragrance16-Sep-06 0:47 
GeneralRe: How to access a function in another class file Pin
ThatsAlok16-Sep-06 1:06
ThatsAlok16-Sep-06 1:06 
GeneralRe: How to access a function in another class file Pin
vc++_fragrance16-Sep-06 1:39
vc++_fragrance16-Sep-06 1:39 
QuestionHow to read a set of numbers from a textfile to a 2D array? Pin
KaKa'15-Sep-06 22:19
KaKa'15-Sep-06 22:19 
AnswerRe: How to read a set of numbers from a textfile to a 2D array? Pin
ThatsAlok16-Sep-06 1:07
ThatsAlok16-Sep-06 1:07 
GeneralRe: How to read a set of numbers from a textfile to a 2D array? Pin
Hamid_RT16-Sep-06 1:45
Hamid_RT16-Sep-06 1:45 
QuestionSETUP.exe Pin
J512198215-Sep-06 20:58
J512198215-Sep-06 20:58 
AnswerRe: SETUP.exe Pin
ThatsAlok16-Sep-06 1:07
ThatsAlok16-Sep-06 1:07 

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.