Click here to Skip to main content
15,897,704 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDragListBox with additions Pin
Luksky28-May-06 4:30
Luksky28-May-06 4:30 
AnswerRe: DragListBox with additions Pin
Luksky28-May-06 11:57
Luksky28-May-06 11:57 
QuestionHow do i make another window w/o code Pin
Haun the 2nd28-May-06 2:51
Haun the 2nd28-May-06 2:51 
AnswerRe: How do i make another window w/o code Pin
bob1697228-May-06 7:33
bob1697228-May-06 7:33 
GeneralRe: How do i make another window w/o code Pin
ThatsAlok28-May-06 23:02
ThatsAlok28-May-06 23:02 
AnswerRe: How do i make another window w/o code Pin
Haun the 2nd29-May-06 5:59
Haun the 2nd29-May-06 5:59 
GeneralRe: How do i make another window w/o code Pin
ThatsAlok29-May-06 18:57
ThatsAlok29-May-06 18:57 
QuestionDouble buffering Pin
Luksky28-May-06 0:29
Luksky28-May-06 0:29 
What's wrong with this code? It draws, but with great flickering. I red many articles about double buffering, but it seems that I don't understand them.Sigh | :sigh:
Please help. :/

void CGrafikView::OnDraw(CDC* pDC)
{
CGrafikDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);

// TODO:
CRect rc;
GetClientRect(&rc);

CDC dcMem;
dcMem.CreateCompatibleDC(pDC);
CBitmap bmpMem;
bmpMem.DeleteObject();
bmpMem.CreateCompatibleBitmap( pDC, rc.right, rc.bottom );
CBitmap * oldBmp = dcMem.SelectObject( &bmpMem );

CPen penBorder( PS_SOLID, 1, crBordercolor );
CPen penNull;
penNull.CreateStockObject( NULL_PEN );
CBrush brushBg( crBgcolor );
CBrush brushFill( RGB(204,204,204) );
CBrush brushNull;
brushNull.CreateStockObject( NULL_BRUSH );

CPen * oldPen = dcMem.SelectObject( &penNull );
CBrush * oldBrush = dcMem.SelectObject( &brushBg );
dcMem.Rectangle(&rc);

dcMem.SelectObject( &penBorder );
dcMem.SelectObject( &brushFill );
dcMem.Rectangle( startX-1, startY-1, startX+uWidth+1, startY+uHeight+1 );

//--------------------------------------
pDC->BitBlt( 0, 0, rc.right, rc.bottom,
&dcMem, 0, 0, SRCCOPY ); //--------------------------------------

dcMem.SelectObject( &oldPen );
dcMem.SelectObject( &oldBrush );
dcMem.SelectObject( &oldBmp );
}

Lukas

~~~~
AnswerRe: Double buffering Pin
Hamid_RT28-May-06 1:29
Hamid_RT28-May-06 1:29 
GeneralRe: Double buffering Pin
Luksky28-May-06 4:19
Luksky28-May-06 4:19 
AnswerRe: Double buffering Pin
bob1697228-May-06 6:50
bob1697228-May-06 6:50 
GeneralRe: Double buffering Pin
Luksky28-May-06 8:56
Luksky28-May-06 8:56 
GeneralRe: Double buffering Pin
bob1697228-May-06 10:41
bob1697228-May-06 10:41 
GeneralRe: Double buffering Pin
Luksky28-May-06 11:56
Luksky28-May-06 11:56 
GeneralRe: Double buffering Pin
bob1697228-May-06 13:53
bob1697228-May-06 13:53 
QuestionOffice Outlook/Outlook Express/Msn Messenger Pin
YaronNir27-May-06 22:09
YaronNir27-May-06 22:09 
AnswerRe: Office Outlook/Outlook Express/Msn Messenger Pin
YaronNir28-May-06 0:02
YaronNir28-May-06 0:02 
GeneralRe: Office Outlook/Outlook Express/Msn Messenger Pin
ThatsAlok28-May-06 23:32
ThatsAlok28-May-06 23:32 
GeneralRe: Office Outlook/Outlook Express/Msn Messenger Pin
YaronNir29-May-06 0:29
YaronNir29-May-06 0:29 
GeneralRe: Office Outlook/Outlook Express/Msn Messenger Pin
ThatsAlok29-May-06 19:08
ThatsAlok29-May-06 19:08 
GeneralRe: Office Outlook/Outlook Express/Msn Messenger Pin
YaronNir29-May-06 20:04
YaronNir29-May-06 20:04 
AnswerRe: Office Outlook/Outlook Express/Msn Messenger [modified] Pin
Hamid_RT28-May-06 2:31
Hamid_RT28-May-06 2:31 
GeneralRe: Office Outlook/Outlook Express/Msn Messenger [modified] Pin
YaronNir28-May-06 2:38
YaronNir28-May-06 2:38 
GeneralRe: Office Outlook/Outlook Express/Msn Messenger Pin
ThatsAlok29-May-06 19:15
ThatsAlok29-May-06 19:15 
GeneralRe: Office Outlook/Outlook Express/Msn Messenger Pin
YaronNir29-May-06 19:59
YaronNir29-May-06 19:59 

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.