Click here to Skip to main content
16,006,442 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
JokeHelp -Voice Recognition- Visual Basic...Excel Macro Pin
usha_dolly6-Dec-05 0:14
usha_dolly6-Dec-05 0:14 
QuestionProblems rendering flash object on WebControl Pin
razvar28-Nov-05 5:18
razvar28-Nov-05 5:18 
QuestionC++ and mysql, any suggestions? Pin
includeh1028-Nov-05 5:08
includeh1028-Nov-05 5:08 
AnswerRe: C++ and mysql, any suggestions? Pin
Bob Stanneveld28-Nov-05 7:35
Bob Stanneveld28-Nov-05 7:35 
GeneralRe: C++ and mysql, any suggestions? Pin
includeh1028-Nov-05 12:00
includeh1028-Nov-05 12:00 
AnswerRe: C++ and mysql, any suggestions? Pin
S Douglas28-Nov-05 19:14
professionalS Douglas28-Nov-05 19:14 
QuestionHowto draw line while mousemove Pin
AnTri28-Nov-05 4:33
AnTri28-Nov-05 4:33 
AnswerRe: Howto draw line while mousemove Pin
Cedric Moonen28-Nov-05 4:55
Cedric Moonen28-Nov-05 4:55 
One golden rule in windows drawing is that NOTHING is stored when you draw something on your window !! So, when you call InvalidateRect, it will repaint your window and thus erase what you did. This is something really important and you have to remember whenever you want to make drawings on a window.

Now, the way to 'solve the problem': when you should normally draw your line (in your case, probably in OnMouseMove), instead of directly drawing on the screen, save in your class what need to be drawn (the coordinates of the start and end points of your line). Then call Invalidate. This will result in calling (indirectly) the OnPaint function. In this function, you will do the drawing ! So, like that, even when your windows is repainted due to external events (when your window has been hidden and then visible again for exemple), your data drawn on screen won't be lost but redrawn again each time instead.

Hope this is clear Smile | :)
GeneralRe: Howto draw line while mousemove Pin
ShivamShukla29-Nov-10 1:38
ShivamShukla29-Nov-10 1:38 
AnswerRe: Howto draw line while mousemove Pin
PJ Arends28-Nov-05 7:35
professionalPJ Arends28-Nov-05 7:35 
QuestionGetProcAddress Problems: Part 2 Pin
Bobamagoo28-Nov-05 4:29
Bobamagoo28-Nov-05 4:29 
AnswerRe: GetProcAddress Problems: Part 2 Pin
PJ Arends28-Nov-05 9:22
professionalPJ Arends28-Nov-05 9:22 
GeneralRe: GetProcAddress Problems: Part 2 Pin
Gary R. Wheeler28-Nov-05 14:13
Gary R. Wheeler28-Nov-05 14:13 
GeneralRe: GetProcAddress Problems: Part 2 Pin
PJ Arends28-Nov-05 14:21
professionalPJ Arends28-Nov-05 14:21 
QuestionSize MDI Client Area Pin
melliw28-Nov-05 2:44
melliw28-Nov-05 2:44 
QuestionHow to detect fullscreen? Pin
anycallmy28-Nov-05 2:13
anycallmy28-Nov-05 2:13 
AnswerRe: How to detect fullscreen? Pin
razvar28-Nov-05 5:35
razvar28-Nov-05 5:35 
GeneralRe: How to detect fullscreen? Pin
anycallmy28-Nov-05 17:31
anycallmy28-Nov-05 17:31 
Questionround off function in vc.net Pin
salaikumar28-Nov-05 2:09
salaikumar28-Nov-05 2:09 
AnswerRe: round off function in vc.net Pin
toxcct28-Nov-05 3:15
toxcct28-Nov-05 3:15 
AnswerRe: round off function in vc.net Pin
jhwurmbach28-Nov-05 3:31
jhwurmbach28-Nov-05 3:31 
QuestionDatagrid column backcolor in vc.net Pin
salaikumar28-Nov-05 2:07
salaikumar28-Nov-05 2:07 
QuestionCSocket Receive Problem Pin
Sarath C28-Nov-05 1:51
Sarath C28-Nov-05 1:51 
Questionhow to set images onto outlookbar' folders? Pin
gzy900128-Nov-05 1:08
gzy900128-Nov-05 1:08 
QuestionFunction pointer and Member function pointer Pin
tbrake28-Nov-05 0:10
tbrake28-Nov-05 0:10 

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.