Click here to Skip to main content
15,911,762 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: dice generation Pin
CPallini29-May-09 21:25
mveCPallini29-May-09 21:25 
AnswerRe: dice generation Pin
swtlibra29-May-09 21:36
swtlibra29-May-09 21:36 
QuestionRe: dice generation Pin
CPallini30-May-09 2:56
mveCPallini30-May-09 2:56 
AnswerRe: dice generation Pin
swtlibra30-May-09 23:42
swtlibra30-May-09 23:42 
GeneralRe: dice generation Pin
CPallini31-May-09 0:02
mveCPallini31-May-09 0:02 
QuestionThe peculiarities of reality : leaner but not faster ? Pin
GJBR29-May-09 10:30
GJBR29-May-09 10:30 
AnswerRe: The peculiarities of reality : leaner but not faster ? Pin
David Crow29-May-09 10:58
David Crow29-May-09 10:58 
GeneralRe: The peculiarities of reality : leaner but not faster ? Pin
GJBR29-May-09 11:10
GJBR29-May-09 11:10 
AnswerRe: The peculiarities of reality : leaner but not faster ? Pin
BobInNJ29-May-09 11:14
BobInNJ29-May-09 11:14 
GeneralRe: The peculiarities of reality : leaner but not faster ? Pin
GJBR29-May-09 11:42
GJBR29-May-09 11:42 
AnswerRe: The peculiarities of reality : leaner but not faster ? Pin
Stuart Dootson29-May-09 13:14
professionalStuart Dootson29-May-09 13:14 
AnswerRe: The peculiarities of reality : leaner but not faster ? Pin
Joe Woodbury29-May-09 13:29
professionalJoe Woodbury29-May-09 13:29 
AnswerRe: The peculiarities of reality : leaner but not faster ? Pin
Luc Pattyn29-May-09 13:40
sitebuilderLuc Pattyn29-May-09 13:40 
Questionimage in picture control not displayed properly after moving Pin
dumnbncool29-May-09 10:06
dumnbncool29-May-09 10:06 
Questionurgent help Pin
ramina sen29-May-09 8:18
ramina sen29-May-09 8:18 
AnswerRe: urgent help Pin
David Crow29-May-09 8:28
David Crow29-May-09 8:28 
GeneralRe: urgent help Pin
ramina sen29-May-09 8:33
ramina sen29-May-09 8:33 
GeneralRe: urgent help Pin
Cedric Moonen29-May-09 8:51
Cedric Moonen29-May-09 8:51 
GeneralRe: urgent help Pin
CPallini29-May-09 8:58
mveCPallini29-May-09 8:58 
GeneralRe: urgent help Pin
krmed29-May-09 10:17
krmed29-May-09 10:17 
RantRe: urgent help Pin
Michael Schubert29-May-09 12:43
Michael Schubert29-May-09 12:43 
GeneralRe: urgent help Pin
Jim Crafton29-May-09 8:38
Jim Crafton29-May-09 8:38 
AnswerRe: urgent help Pin
Wes Aday29-May-09 9:22
professionalWes Aday29-May-09 9:22 
QuestionWriting a Smart OnPaint Routine Pin
BobInNJ29-May-09 7:15
BobInNJ29-May-09 7:15 
I am trying to understand how to write an efficient OnPaint routine. That is, I want my routine
to only update the part of the screen that needs to be updated. Therefore I wrote a simple program
that creates a window and displays three lines. Below is the OnPaint routine for that program:

void<br />
CMainWindow::OnPaint()<br />
{<br />
	CPaintDC dc(this);<br />
<br />
	RECT rect1;<br />
	BOOL retValue = GetUpdateRect( &rect1 );<br />
	if ( retValue != 0 ) {<br />
		char *ptr = 0;<br />
		*ptr = 23;<br />
	}<br />
	dc.BitBlt( 0, 0, maxX, maxY, &m_memDC, 0, 0, SRCCOPY );<br />
}


The code works but the routine GetUpdateRect always returns 0. I am wondering if the only way to
get GetUpdateRect to return non-zero is if the program sends (via something like SendMessage)
the WM_PAINT message.

You should also observe that in the current code, if GetUpdateRect does return a non-zero value
then the program crashes. Currently, the program never crashes.

Bob
AnswerRe: Writing a Smart OnPaint Routine Pin
CPallini29-May-09 7:39
mveCPallini29-May-09 7:39 

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.