Click here to Skip to main content
15,917,174 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to catch Dial-up dialog ???? Pin
Le Nhan2-Apr-02 17:11
Le Nhan2-Apr-02 17:11 
AnswerRe: how to catch Dial-up dialog ???? Pin
Mazdak2-Apr-02 18:40
Mazdak2-Apr-02 18:40 
GeneralLinking error in VC++.NET Pin
Adam Clauss2-Apr-02 16:45
Adam Clauss2-Apr-02 16:45 
GeneralRe: Linking error in VC++.NET Pin
Mike Nordell2-Apr-02 22:14
Mike Nordell2-Apr-02 22:14 
GeneralRe: Linking error in VC++.NET Pin
Adam Clauss3-Apr-02 2:39
Adam Clauss3-Apr-02 2:39 
GeneralRe: Linking error in VC++.NET Pin
Tim Smith3-Apr-02 2:23
Tim Smith3-Apr-02 2:23 
GeneralRe: Linking error in VC++.NET Pin
Adam Clauss3-Apr-02 2:38
Adam Clauss3-Apr-02 2:38 
QuestionDoes this cause the memory leak when I draw on a view? Pin
Feng Qin2-Apr-02 15:58
Feng Qin2-Apr-02 15:58 
I do some draw action:

void CMyView::OnPaint()
{
CPaintDC dc(this); // device context for painting

if( m_bDraw == FALSE )
return;
/**/
CDC* pDC = GetDC();
CDC cacheDC;
VERIFY( cacheDC.CreateCompatibleDC( pDC ));

if( m_pBitmap == NULL )
{
m_pBitmap = new CBitmap;
VERIFY( m_pBitmap->CreateCompatibleBitmap( pDC, m_ClientRect.Width(), m_ClientRect.Height() ) );
}

CBitmap* pOldBmp = cacheDC.SelectObject( m_pBitmap );

//Draw background
CRect rect( m_ClientRect );
cacheDC.FillSolidRect( &rect, RGB(255, 255, 255) );
//cacheDC.Rectangle( rect );
cacheDC.Draw3dRect( &rect, RGB( 0, 0, 0 ), RGB( 255, 255, 255 ) );

//!! Some draw actions here, use cacheDC

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


cacheDC.SelectObject( pOldBmp );
cacheDC.DeleteDC();

}


When I open tha "TaskManager", I notice that the memory usage of My app is increase, what's wrong with my draw method?Confused | :confused:

I'm amumu, and you?
AnswerRe: Does this cause the memory leak when I draw on a view? Pin
Paul M Watt2-Apr-02 16:41
mentorPaul M Watt2-Apr-02 16:41 
GeneralRe: Does this cause the memory leak when I draw on a view? Pin
Feng Qin2-Apr-02 18:02
Feng Qin2-Apr-02 18:02 
GeneralRe: Does this cause the memory leak when I draw on a view? Pin
Paul M Watt2-Apr-02 19:19
mentorPaul M Watt2-Apr-02 19:19 
GeneralRe: Does this cause the memory leak when I draw on a view? Pin
Feng Qin2-Apr-02 23:10
Feng Qin2-Apr-02 23:10 
AnswerRe: Does this cause the memory leak when I draw on a view? Pin
Roger Allen2-Apr-02 23:33
Roger Allen2-Apr-02 23:33 
QuestionHow Can I get MFC support in ATL EXE COM Server project! Pin
wabc2-Apr-02 15:49
wabc2-Apr-02 15:49 
GeneralCreating custom types Pin
2-Apr-02 15:31
suss2-Apr-02 15:31 
GeneralRe: Creating custom types Pin
Christian Graus2-Apr-02 15:45
protectorChristian Graus2-Apr-02 15:45 
GeneralRe: Creating custom types Pin
2-Apr-02 20:31
suss2-Apr-02 20:31 
GeneralRe: Creating custom types Pin
alex.barylski2-Apr-02 23:17
alex.barylski2-Apr-02 23:17 
GeneralDialogs in MDI app have gray titlebar Pin
Jack Handy2-Apr-02 15:20
Jack Handy2-Apr-02 15:20 
GeneralRe: Dialogs in MDI app have gray titlebar Pin
Shog92-Apr-02 20:29
sitebuilderShog92-Apr-02 20:29 
GeneralRe: Dialogs in MDI app have gray titlebar Pin
Jack Handy2-Apr-02 21:26
Jack Handy2-Apr-02 21:26 
GeneralCreate DialogBar from CDialog Pin
2-Apr-02 13:56
suss2-Apr-02 13:56 
Generalset<int>::find crashing Pin
Cathy2-Apr-02 12:47
Cathy2-Apr-02 12:47 
GeneralRe: set<int>::find crashing Pin
Paul M Watt2-Apr-02 13:08
mentorPaul M Watt2-Apr-02 13:08 
GeneralRe: set<int>::find crashing Pin
Cathy2-Apr-02 13:15
Cathy2-Apr-02 13: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.