Click here to Skip to main content
16,005,080 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: ShellExecute with new instance Pin
Stuart Dootson17-Dec-08 2:19
professionalStuart Dootson17-Dec-08 2:19 
QuestionHow to load bitmap to a button Pin
Pryabu17-Dec-08 1:01
Pryabu17-Dec-08 1:01 
AnswerRe: How to load bitmap to a button Pin
Hamid_RT17-Dec-08 1:11
Hamid_RT17-Dec-08 1:11 
GeneralRe: How to load bitmap to a button Pin
Pryabu17-Dec-08 1:15
Pryabu17-Dec-08 1:15 
GeneralRe: How to load bitmap to a button Pin
Pryabu17-Dec-08 1:27
Pryabu17-Dec-08 1:27 
GeneralRe: How to load bitmap to a button Pin
Pryabu17-Dec-08 2:06
Pryabu17-Dec-08 2:06 
AnswerRe: How to load bitmap to a button Pin
_AnsHUMAN_ 17-Dec-08 1:13
_AnsHUMAN_ 17-Dec-08 1:13 
QuestionRedrawing.. Pin
staticv17-Dec-08 0:59
staticv17-Dec-08 0:59 
// Verify the left button is down
	if ((nFlags & MK_LBUTTON) && (this == GetCapture()))
	{
		m_SecondPoint = point;				// Save the current cursor position

		if (m_pTempElement)
		{
			// Redraw the old element so it disappears from the view
			m_pTempElement->Draw(&aDC);
			delete m_pTempElement;				// Delete the old element
			m_pTempElement = 0;				// Reset the pointer to 0
		}

		// Create a temporary element of the type and color that
		// is recorded in the document object and draw it
		m_pTempElement = CreateElement();			// Create a new element
		m_pTempElement->Draw(&aDC);					// Draw the element
	}


This is a code of a message handler in a drawing application which now supports drawing lines, rectangles and circles.

We save the first cursor position in the Mouse button down handler

The CreateElement() creates an element (rectangle, circle, line, curve) on the heap and returns a pointer to it.

I don't understand why do we need to redraw the old element. Like I created an element and then a mouse move occurs then why do we draw it two times? First, in the inner if block and second, after the if block.

It is drawing over the previously drawn element in the inner if block right?

Top Web Hosting Providers[^]

Whatever the mind can conceive and believe, the mind can achieve - Dr. Napoleon Hill

AnswerRe: Redrawing.. Pin
CPallini17-Dec-08 1:44
mveCPallini17-Dec-08 1:44 
AnswerRe: Redrawing.. Pin
L. Madhavan17-Dec-08 2:16
L. Madhavan17-Dec-08 2:16 
QuestionDisplaying painted areas on Property Sheet Pin
koumodaki17-Dec-08 0:19
koumodaki17-Dec-08 0:19 
AnswerRe: Displaying painted areas on Property Sheet Pin
Iain Clarke, Warrior Programmer17-Dec-08 0:46
Iain Clarke, Warrior Programmer17-Dec-08 0:46 
GeneralOT- Good article Iain Pin
CPallini17-Dec-08 1:36
mveCPallini17-Dec-08 1:36 
GeneralRe: OT- Good article Iain Pin
Iain Clarke, Warrior Programmer17-Dec-08 2:23
Iain Clarke, Warrior Programmer17-Dec-08 2:23 
GeneralRe: OT- Good article Iain Pin
CPallini17-Dec-08 2:39
mveCPallini17-Dec-08 2:39 
GeneralRe: Displaying painted areas on Property Sheet Pin
koumodaki17-Dec-08 2:19
koumodaki17-Dec-08 2:19 
AnswerRe: Displaying painted areas on Property Sheet Pin
Code-o-mat17-Dec-08 0:58
Code-o-mat17-Dec-08 0:58 
GeneralRe: Displaying painted areas on Property Sheet Pin
koumodaki17-Dec-08 2:21
koumodaki17-Dec-08 2:21 
Questionhow to change the label of button of Dialog box Pin
vikas choudhry16-Dec-08 23:41
vikas choudhry16-Dec-08 23:41 
AnswerRe: how to change the label of button of Dialog box Pin
Jijo.Raj17-Dec-08 0:03
Jijo.Raj17-Dec-08 0:03 
AnswerRe: how to change the label of button of Dialog box Pin
Code-o-mat17-Dec-08 0:04
Code-o-mat17-Dec-08 0:04 
GeneralRe: how to change the label of button of Dialog box Pin
Rajib Podder17-Dec-08 22:22
Rajib Podder17-Dec-08 22:22 
GeneralRe: how to change the label of button of Dialog box Pin
Code-o-mat17-Dec-08 22:41
Code-o-mat17-Dec-08 22:41 
GeneralRe: how to change the label of button of Dialog box Pin
Rajib Podder18-Dec-08 1:07
Rajib Podder18-Dec-08 1:07 
GeneralRe: how to change the label of button of Dialog box Pin
Code-o-mat18-Dec-08 1:44
Code-o-mat18-Dec-08 1:44 

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.