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

C / C++ / MFC

 
GeneralRe: modeless dialog and memory leak Pin
Christian Graus16-May-02 12:02
protectorChristian Graus16-May-02 12:02 
GeneralRe: modeless dialog and memory leak Pin
lucy16-May-02 12:59
lucy16-May-02 12:59 
GeneralRe: modeless dialog and memory leak Pin
Jason Henderson16-May-02 11:36
Jason Henderson16-May-02 11:36 
GeneralRe: modeless dialog and memory leak Pin
Nish Nishant16-May-02 14:39
sitebuilderNish Nishant16-May-02 14:39 
GeneralRe: modeless dialog and memory leak Pin
lucy17-May-02 3:20
lucy17-May-02 3:20 
QuestionHow do i catch events from a ListView control? Pin
redeemer16-May-02 9:26
redeemer16-May-02 9:26 
AnswerRe: How do i catch events from a ListView control? Pin
Ravi Bhavnani16-May-02 10:57
professionalRavi Bhavnani16-May-02 10:57 
GeneralStill having problems double buffering a CListView MDI Pin
RobJones16-May-02 8:09
RobJones16-May-02 8:09 
Hello,
Here is some code.. I am trying to double buffer my CListView MDI app.. I am getting all kinds of really weird drawing.. Alot of this code is from a CListCtrl double buffer.. I am trying to use it.. Anyone want to see if they can find some problems.. Thanks!!!

// This is my OnPaint()
CRect  rc;
	GetParent()->GetClientRect(&rc);

	if (rc.Size() == CSize(0,0))
		return;

	CPaintDC dc(this);
	CDC     MemoryDC;
	CBitmap Bitmap;
	CBrush  Brush;

	CRect rcWnd;
	GetWindowRect(&rcWnd);
	int rcWndW = rcWnd.Width(), rcWndH = rcWnd.Height();

	// Paint to a compatible DC
	MemoryDC.CreateCompatibleDC(&dc);
	Bitmap.CreateCompatibleBitmap(&dc, rcWndW, rcWndH);
	CBitmap *pOldBitmap = MemoryDC.SelectObject(&Bitmap);
   
	// Fill background (does what WM_ERASEBKGND would do)
	Brush.CreateSolidBrush(RGB(255,255,255));//GetBkColor());
	MemoryDC.FillRect(&CRect(0,0, rcWndW,rcWndH), &Brush);

	// Hook the header control so that paint gets redirected
	// to the memory dc
	CWMPaintHook  hookHeaderCtrl(GetListCtrl().GetHeaderCtrl()->GetSafeHwnd(), MemoryDC);

	// Do client and children areas first otherwise system
	// scrollbars don't draw correctly.
	Print(&MemoryDC, PRF_CLIENT|PRF_CHILDREN);
	Print(&MemoryDC, PRF_NONCLIENT);

	// Offset the MemoryDC drawing rectangle by rcBounds 
	CRect rcDraw = rc - rc.TopLeft();

	// Dump bits to real device context.
	dc.BitBlt(rc.left,rc.top, rc.Width(),rc.Height(), &MemoryDC, rcDraw.left,rcDraw.top, SRCCOPY);

	MemoryDC.SelectObject(pOldBitmap);


If you need more code, like from my .h let me know and I'll post it.

Thanks,


Rob
GeneralRe: Still having problems double buffering a CListView MDI Pin
RobJones16-May-02 8:19
RobJones16-May-02 8:19 
QuestionConvert the string "(5/12)*8" to a number? Pin
Tony Fontenot16-May-02 7:56
Tony Fontenot16-May-02 7:56 
AnswerRe: Convert the string "(5/12)*8" to a number? Pin
Matt Gullett16-May-02 8:15
Matt Gullett16-May-02 8:15 
AnswerRe: Convert the string "(5/12)*8" to a number? Pin
Chris Losinger16-May-02 8:09
professionalChris Losinger16-May-02 8:09 
GeneralError when i try to use std::map Pin
redeemer16-May-02 7:24
redeemer16-May-02 7:24 
GeneralRe: Error when i try to use std::map Pin
Le centriste16-May-02 7:38
Le centriste16-May-02 7:38 
GeneralRe: Error when i try to use std::map Pin
redeemer16-May-02 8:05
redeemer16-May-02 8:05 
GeneralRe: Error when i try to use std::map Pin
Chris Losinger16-May-02 8:07
professionalChris Losinger16-May-02 8:07 
GeneralOne more question Pin
redeemer16-May-02 8:26
redeemer16-May-02 8:26 
GeneralRe: One more question Pin
Chris Losinger16-May-02 8:43
professionalChris Losinger16-May-02 8:43 
GeneralThanks. Works perfectly, you rule! Pin
redeemer16-May-02 9:24
redeemer16-May-02 9:24 
QuestionHow to detect if starting normal/minimized? Pin
16-May-02 7:04
suss16-May-02 7:04 
AnswerRe: How to detect if starting normal/minimized? Pin
PJ Arends16-May-02 7:14
professionalPJ Arends16-May-02 7:14 
GeneralRe: How to detect filename? Pin
16-May-02 7:29
suss16-May-02 7:29 
GeneralRe: How to detect filename? Pin
PJ Arends16-May-02 7:41
professionalPJ Arends16-May-02 7:41 
General3D CEdit Pin
Max Santos16-May-02 7:05
Max Santos16-May-02 7:05 
GeneralRe: 3D , I want 3D Pin
PJ Arends16-May-02 7:09
professionalPJ Arends16-May-02 7:09 

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.